{"record":{"id":"e5a98869111ed591","repo":"n8n-io/n8n","slug":"email-sending-must-be-set-up-in-order-to-request-a","errorCode":null,"errorMessage":"Email sending must be set up in order to request a password reset email","messagePattern":"Email sending must be set up in order to request a password reset email","errorType":"exception","errorClass":"InternalServerError","httpStatus":500,"severity":"error","filePath":"packages/cli/src/controllers/password-reset.controller.ts","lineNumber":79,"sourceCode":"\t@Post('/forgot-password', {\n\t\tskipAuth: true,\n\t\tipRateLimit: { limit: 20, windowMs: 5 * Time.minutes.toMilliseconds },\n\t\tkeyedRateLimit: createBodyKeyedRateLimiter<ForgotPasswordRequestDto>({\n\t\t\tlimit: 3,\n\t\t\tfield: 'email',\n\t\t}),\n\t\tmiddlewares: [createJitterMiddleware({ minMs: 200, maxMs: 1000 })],\n\t})\n\tasync forgotPassword(\n\t\t_req: AuthlessRequest,\n\t\t_res: Response,\n\t\t@Body payload: ForgotPasswordRequestDto,\n\t) {\n\t\tif (!this.mailer.isEmailSetUp) {\n\t\t\tthis.logger.debug(\n\t\t\t\t'Request to send password reset email failed because emailing was not set up',\n\t\t\t);\n\t\t\tthrow new InternalServerError(\n\t\t\t\t'Email sending must be set up in order to request a password reset email',\n\t\t\t);\n\t\t}\n\n\t\ttry {\n\t\t\tconst { email } = payload;\n\n\t\t\t// User should just be able to reset password if one is already present\n\t\t\tconst user = await this.userRepository.findNonShellUser(email);\n\t\t\tif (!user) {\n\t\t\t\tthis.logger.debug('No user found in the system');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (user.role.slug !== GLOBAL_OWNER_ROLE.slug && !this.license.isWithinUsersLimit()) {\n\t\t\t\tthis.logger.debug(\n\t\t\t\t\t'Request to send password reset email failed because the user limit was reached',\n\t\t\t\t);","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/cli/src/controllers/password-reset.controller.ts#L61-L97","documentation":"POST /rest/forgot-password requires SMTP/email to be configured, because the only useful action is sending a reset email. When `mailer.isEmailSetUp` is false, n8n throws InternalServerError (500) — there is no reset path without a mailer.","triggerScenarios":"POST /rest/forgot-password while the UserManagementMailer reports isEmailSetUp === false (no SMTP/connection test config).","commonSituations":"Fresh install with no SMTP env vars; owner never completed the email setup screen; SMTP host/port env removed in a redeploy.","solutions":["Configure SMTP via env vars (N8N_SMTP_HOST, N8N_SMTP_PORT, N8N_SMTP_USER, N8N_SMTP_PASS, etc.) and restart n8n.","Alternatively, have an admin reset the user's password directly via CLI (`n8n user:reset`) or the admin users panel, bypassing email."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Expose mailer.isEmailSetUp via /settings and gate the forgot-password UI.\nif (!settings.emailSetUp) {\n  showNotice('Email is not configured — ask an admin to reset your password.');\n  return;\n}\nawait restApi.post('/forgot-password', { email });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Hide the forgot-password link in the UI until SMTP is configured.","On fresh installs, drive the owner through email setup before exposing password reset.","Provide an admin CLI reset fallback in your runbook."],"tags":["email","smtp","password-reset","config","infrastructure"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}