RocketChat/Rocket.Chat · error · Error
inbox-not-found
Error message
inbox-not-found
What it means
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.
Source
Thrown at apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts:332
type: 'mrkdwn',
text: `> ---\n${replyToMessage.msg.replace(/^/gm, '> ')}`,
},
},
];
delete message.urls;
return message;
},
callbacks.priority.LOW,
'ReplyEmail',
);
export async function sendTestEmailToInbox(emailInboxRecord: IEmailInbox, user: IUser): Promise<void> {
const inbox = inboxes.get(emailInboxRecord.email);
if (!inbox) {
throw new Error('inbox-not-found');
}
const address = user.emails?.find((email) => email.verified)?.address;
if (!address) {
throw new Error('user-without-verified-email');
}
void sendEmail(inbox, {
to: address,
subject: 'Test of inbox configuration',
text: 'Test of inbox configuration successful',
});
}
View on GitHub (pinned to b2c16d5842)
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
Defensive patterns
Strategy: try-catch
Try / catch
try {
await sendTestEmailToInbox(inboxRecord, user);
} catch (e) {
if (e instanceof Error && e.message === 'inbox-not-found') {
// tell the admin the inbox is not active; suggest restart / checking IMAP status
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/0288ac8bf0fb74fd.
Report an issue: GitHub.