{"record":{"id":"3025ab7eca3903d2","repo":"RocketChat/Rocket.Chat","slug":"user-without-verified-email","errorCode":null,"errorMessage":"user-without-verified-email","messagePattern":"user-without-verified-email","errorType":"exception","errorClass":"Error","httpStatus":500,"severity":"error","filePath":"apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts","lineNumber":338,"sourceCode":"\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":320,"sourceCodeEnd":347,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts#L320-L347","documentation":"sendTestEmailToInbox needs a destination and picks the first verified address from the calling user's emails. If user.emails contains no entry with verified:true, it throws 'user-without-verified-email' (a plain Error). The guard is strict because sending a test to an unverified address would bounce or be spam-flagged.","triggerScenarios":"An admin with no email on their profile clicks 'send test email to inbox'; the profile has only unverified addresses; the verification was never completed.","commonSituations":"Admin accounts created via LDAP/SCIM without email verification; test drive before verifying the just-added address; verification email lost in spam.","solutions":["Add an email address to your user profile and verify it via the confirmation link","Resend the verification email from the profile page if it was never confirmed, then retry the test","As a smoke test, use Administration > Email > send test mail instead, which does not depend on the user's verified address"],"exampleFix":"// before\nawait sendTestEmailToInbox(inboxRecord, currentUser);\n\n// after\nconst hasVerified = Boolean(currentUser.emails?.some((e) => e.verified));\nif (!hasVerified) {\n  throw new Error('Verify an email address on your profile before testing the inbox');\n}\nawait sendTestEmailToInbox(inboxRecord, currentUser);","handlingStrategy":"validation","validationCode":"const verifiedAddress = user.emails?.find((e) => e.verified)?.address;\nif (!verifiedAddress) {\n  throw new Error('Add and verify an email address on your profile first');\n}\nawait sendTestEmailToInbox(inboxRecord, user);","typeGuard":"const hasVerifiedEmail = (u: { emails?: Array<{ address: string; verified?: boolean }> }): boolean =>\n  Boolean(u.emails?.some((e) => e.verified));","tryCatchPattern":"try {\n  await sendTestEmailToInbox(inboxRecord, user);\n} catch (e) {\n  if (e instanceof Error && e.message === 'user-without-verified-email') {\n    // direct the user to profile > email verification, then retry\n  }\n}","preventionTips":["Disable the test-send button unless the acting user has a verified email","For admin/LDAP-provisioned accounts, include email verification in onboarding"],"tags":["email","user-profile","verification"],"backgroundTag":"email-not-verified","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"}