fix(email): attach a Message-ID header to every outbound message #327
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-334-message-id-header"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
send_email built messages with only From/To/Subject/body and never set a Message-ID, so every mail bunyip sent went out without one. Gmail rejects such mail with 550 5.7.1 RfcMessageNonCompliant, bouncing user-facing email (verification, password reset, email change) to Gmail recipients.
Extract a build_message helper from send_email and set an explicit Message-ID of the form uuid@domain, where domain is derived from config.from_email (fallback a8n.run) so it aligns with the From / DKIM d= domain. Fixing the single send_email choke point covers every email type. Add unit tests asserting exactly one RFC 5322-compliant Message-ID header with the expected domain and that IDs are unique per send.
#BUNYIP-334