{"record":{"id":"0288ac8bf0fb74fd","repo":"RocketChat/Rocket.Chat","slug":"inbox-not-found","errorCode":null,"errorMessage":"inbox-not-found","messagePattern":"inbox-not-found","errorType":"exception","errorClass":"Error","httpStatus":500,"severity":"error","filePath":"apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts","lineNumber":332,"sourceCode":"\t\t\t\t\ttype: 'mrkdwn',\n\t\t\t\t\ttext: `> ---\\n${replyToMessage.msg.replace(/^/gm, '> ')}`,\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\n\t\tdelete message.urls;\n\n\t\treturn message;\n\t},\n\tcallbacks.priority.LOW,\n\t'ReplyEmail',\n);\n\nexport async function sendTestEmailToInbox(emailInboxRecord: IEmailInbox, user: IUser): Promise<void> {\n\tconst inbox = inboxes.get(emailInboxRecord.email);\n\n\tif (!inbox) {\n\t\tthrow new Error('inbox-not-found');\n\t}\n\n\tconst address = user.emails?.find((email) => email.verified)?.address;\n\n\tif (!address) {\n\t\tthrow new Error('user-without-verified-email');\n\t}\n\n\tvoid sendEmail(inbox, {\n\t\tto: address,\n\t\tsubject: 'Test of inbox configuration',\n\t\ttext: 'Test of inbox configuration successful',\n\t});\n}\n","sourceCodeStart":314,"sourceCodeEnd":347,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts#L314-L347","documentation":"sendTestEmailToInbox looks up emailInboxRecord.email in the module-level `inboxes` Map, which only holds currently-active IMAP inbox connections registered by the incoming-email handling. 'inbox-not-found' (a plain Error, not Meteor.Error) means no live inbox is registered under that exact email address — the inbox worker is not running, not connected, or the record's email does not match the key the inbox registered under.","triggerScenarios":"Sending the test email right after server start before the IMAP inbox connected; the inbox record's email was edited without re-registering; IMAP connection failed at startup so the inbox never entered the map; calling on an instance whose process-local map does not hold the connection.","commonSituations":"Admin edits an inbox and immediately clicks 'send test email'; multi-instance deployments where the request lands on a node without the inbox worker; IMAP host temporarily down at boot so registration never happened.","solutions":["Confirm the inbox shows as active/connected in Administration > Email > Email Inboxes before testing","Restart the server (or trigger the inbox worker) so the inbox registers in the map","Make sure emailInboxRecord.email exactly matches the address the inbox was registered with","On multi-instance setups, route the test to the instance holding the inbox connection"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await sendTestEmailToInbox(inboxRecord, user);\n} catch (e) {\n  if (e instanceof Error && e.message === 'inbox-not-found') {\n    // tell the admin the inbox is not active; suggest restart / checking IMAP status\n  }\n}","preventionTips":["Only expose the 'send test email' action when the inbox reports an active connection","After editing an inbox record, restart/re-register the inbox before testing","On multi-instance deployments, remember the inboxes map is per-process — route accordingly"],"tags":["email-inbox","imap","server-state"],"backgroundTag":"resource-not-found","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}