KamoCRM

Key the cross-root retry on alias-domain membership, not root-or-not

FixEmailService
Shipped
October 4, 2026 at 5:22 PM UTC
Author
Kamo
Commit
0c54f7a

Round 3 review (email-fix-review-3.md) confirmed round 2's BLOCKER fixed (walked sage@kamouniverse.com through both the app code and Postfix's own platform-alias rewrite rule live, end to end — they agree) and confirmed the +tag fold's removal correct (re-verified recipient_delimiter disabled on both postfix and dovecot, and both **************** use a literal full-address match). It found one new MAJOR: round 2 fixed the BLOCKER by dropping the retry's guard unconditionally, which traded it for a false ACCEPT. An org with two real, independent root domains that are not aliases of each other (explicitly permitted by **************** would have a guess on one root (info@kamocrm.com, nobody's mailbox) falsely resolved merely because an unrelated mailbox (info@brandb.com) exists on the other root — Postfix only rewrites domains actually listed in virtual_alias_domains, and two independent roots have no such relationship, so the send would still 550. Fix: resolves() now receives the alias-domains set (already computed in the caller, previously merged into one undifferentiated "ownDomains" set and discarded before reaching resolves()) and gates the cross-root retry on aliasDomains.contains(domain) instead of on whether domain is (not) a root. This is the one condition both scenarios actually turn on: kamouniverse.com is registered as an alias domain (retry runs, closing round 2's BLOCKER), while a second independent root is not an alias of anything (no retry triggered by a guess on the other root, closing this round's MAJOR). Tests: new case **************** (org owns kamocrm.com and brandb.com, no alias relationship; brandb.com has a real info@ mailbox; info@kamocrm.com must stay unresolved) confirmed RED against round 2's unmodified code (1 failure, via `git stash` of just the implementation file), GREEN after. The existing BLOCKER regression test **************** was already green under round 2's code, as round 3's review independently confirmed, and stays green under this fix too — this round changes only the two-independent-roots outcome, not the dual-registered-domain one. heavy mvn test **************** 82 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