{"record":{"id":"aa15b00d829e72cd","repo":"DIYgod/RSSHub","slug":"email-inbox-rss-is-disabled-due-to-the-lack-of-a","errorCode":null,"errorMessage":"Email Inbox RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/#route-specific-configurations\">relevant config</a>","messagePattern":"Email Inbox RSS is disabled due to the lack of <a href=\"https://docs\\.rsshub\\.app/deploy/#route-specific-configurations\">relevant config</a>","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":null,"severity":"error","filePath":"lib/routes/mail/imap.ts","lineNumber":35,"sourceCode":"        folder: 'Inbox name, `INBOX` by default',\n    },\n    description: 'Only support IMAP protocol, email password and other settings refer to [Route-specific Configurations](https://docs.rsshub.app/deploy/config#route-specific-configurations)',\n    name: 'Inbox',\n    maintainers: ['kt286'],\n    handler,\n};\n\nasync function handler(ctx) {\n    const { email, folder = 'INBOX' } = ctx.req.param();\n    const { limit = 10 } = ctx.req.query();\n    const mailConfig: { username: string; port: number | string; password?: string; host?: string } = {\n        username: email,\n        port: 993,\n        ...Object.fromEntries(new URLSearchParams(config.email.config[email.replaceAll(/[.@]/g, '_')])),\n    };\n\n    if (!mailConfig.username || !mailConfig.password || !mailConfig.host || !mailConfig.port) {\n        throw new ConfigNotFoundError('Email Inbox RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/#route-specific-configurations\">relevant config</a>');\n    }\n\n    const client = new ImapFlow({\n        host: mailConfig.host,\n        port: Number.parseInt(String(mailConfig.port)),\n        secure: true,\n        auth: {\n            user: mailConfig.username,\n            pass: mailConfig.password,\n        },\n        proxy: config.proxyUri, // Note: socks5h is not supported\n        logger: {\n            debug: (log) => logger.debug(log.msg),\n            info: (log) => logger.info(log.msg),\n            warn: (log) => logger.warn(log.msg),\n            error: (log) => logger.error(log?.msg),\n        },\n    });","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/mail/imap.ts#L17-L53","documentation":"Thrown by the Email IMAP handler (lib/routes/mail/imap.ts:35) as a `ConfigNotFoundError` when any of `username`, `password`, `host`, or `port` is missing on the resolved `mailConfig`. The per-account config is read from `config.email.config[<email with .@ -> _>]` as a query-string blob; if that entry is absent or incomplete the handler aborts.","triggerScenarios":"Requesting `/mail/imap/<email>/...` for an account not present in `EMAIL_CONFIG_<sanitized>`; config string missing `host`/`password`; env var naming mismatch (the sanitized email key must match `email.replaceAll(/[.@]/g, '_')`).","commonSituations":"Fresh install with no email config; adding a new account without the matching env entry; typos in the sanitized key (e.g. forgetting to replace `@` and `.` with `_`).","solutions":["Set `EMAIL_CONFIG_<email_with_dot_at_as_underscore>=host=imap.example.com&port=993&password=...` (query-string form) in the RSSHub environment.","Ensure the sanitized key exactly matches the requested email with `.` and `@` replaced by `_`.","Restart RSSHub after editing config."],"exampleFix":"// before: no config for rss@rsshub.app\n// after (env):\nEMAIL_CONFIG_rss_rsshub_app=host=imap.rsshub.app&port=993&password=secret","handlingStrategy":"validation","validationCode":"function mailConfigComplete(c: { username?: string; password?: string; host?: string; port?: number | string }): boolean {\n    return Boolean(c.username && c.password && c.host && c.port);\n}","typeGuard":"interface MailConfig { username: string; password: string; host: string; port: number | string }\nfunction isCompleteMailConfig(c: unknown): c is MailConfig {\n    return typeof c === 'object' && c !== null && typeof (c as MailConfig).username === 'string' && typeof (c as MailConfig).password === 'string' && typeof (c as MailConfig).host === 'string' && (c as MailConfig).port != null;\n}","tryCatchPattern":"import ConfigNotFoundError from '@/errors/types/config-not-found';\ntry {\n    await fetchImapInbox(email);\n} catch (e) {\n    if (e instanceof ConfigNotFoundError && /Email Inbox RSS is disabled/.test(e.message)) {\n        return { disabled: true, reason: `No EMAIL_CONFIG entry for '${email}'` };\n    }\n    throw e;\n}","preventionTips":["Use the sanitized key exactly: replace `.` and `@` with `_`.","Provide all four fields (host, port, password) in the query-string value.","Validate config on boot and log missing accounts."],"tags":["config","missing-secret","imap","email"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}