KamoCRM

Name the unknown recipient instead of a generic send failure

Fixkamo-internal
Shipped
September 29, 2026 at 2:05 AM UTC
Author
Kamo
Commit
96a5ffa

Review round-1 MAJOR: EmailService's RecipientDomainValidator now answers 422 RECIPIENTS_UNKNOWN before a send is attempted whose recipient names one of the organization's own mail domains but matches no mailbox, alias, shared mailbox or personal mailbox (D-luna-1). sendError.ts already parsed code/rejectedRecipients/ message generically — no change needed there to receive it — but MessageTool.tsx and MessageBrowser.tsx only special-cased MESSAGE_TOO_LARGE and RECIPIENTS_REJECTED, so the new code fell through to a bare "Failed to send email"/"Failed to send reply", losing the one piece of information (which address is wrong) the server now computes before ever attempting the send. Before this change, the same mistake would eventually bounce at RCPT TO and the UI would show the specific RECIPIENTS_REJECTED sentence; this was a real regression in message quality for exactly the humans this task protects. classifySendFailure (sendError.ts) centralizes the question "does this response mean something specific, and what addresses" so MessageTool and MessageBrowser can never answer the same server response differently; each still picks its own translated wording via its own recipientsUnknown key (kamo-translation-dictionary, pushed first). Tests: sendError.test.ts gained a classifySendFailure suite (recipientsUnknown, recipientsRejected, sizeLimit, other, and the no-addresses edge case). **************** gained a case for MessageTool; confirmed RED against the pre-fix component (git stash of just that file), then GREEN restored. MessageBrowser.tsx's quick-reply path has no existing test harness for its 2391-line component (documented in email-bug-report.md rather than building one from scratch under this task); the change there is the same shape, verified by classifySendFailure's own tests plus `node scripts/check-i18n-keys.mjs --require-messages` (clean, 4857 files) and a manual TypeScript check. heavy npx vitest run **************** **************** 28 run, 0 failures.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing