421 4.7.32 and 5.7.32: From header not aligned

Quick fix

In the sending service, turn on DKIM signing with your own domain, so the d= domain is your From domain or a subdomain of it.

How to fix it

  1. Open the bounced or a test message and note the domains after header.d= and smtp.mailfrom= in its Authentication-Results header.
  2. In the sending service, turn on DKIM signing with your own domain, so the d= domain is your From domain or a subdomain of it.
  3. Or set a custom bounce (Return-Path) domain under your From domain in the service and add the service to that domain's SPF record.
  4. Keep relaxed alignment (no adkim=s or aspf=s) unless you need strict: Google writes that strict alignment can make mail from your own subdomains fail.
  5. Send a test to a Gmail address and open Show original: DMARC should show PASS.

Learn more: DMARC explained: policy, alignment and reports

How to check

Alignment is decided per message, so start with the bounced or a test message: its Authentication-Results header shows the domain that passed DKIM (header.d=) and SPF (smtp.mailfrom=). The DMARC record parser shows whether your record sets strict alignment with adkim=s or aspf=s, and the DMARC generator builds a record with relaxed alignment. The email spoofing check shows the policy Gmail applies when alignment fails.

The DMARC record generator opens with your domain filled in; it runs when you press Check.

Tools to check it

What the error means

Full error text: 421 5.7.32 Your email was blocked because the From: header (RFC5322) in this message isn't aligned with either the authenticated SPF or DKIM organizational domain.

421 4.7.32 (rate limited) and 421 5.7.32 (blocked) are Gmail's errors for mail whose From domain does not match the domain that passed SPF or DKIM. A message can pass SPF and DKIM and still get this error, because what counts is which domain passed. Gmail's sender guidelines make alignment a rule for senders of more than 5,000 messages per day to Gmail accounts.

Google's list of Gmail SMTP errors has two texts:

  • 421 4.7.32: "Your email has been rate limited because the From: header (RFC5322) in this message isn't aligned with either the authenticated SPF or DKIM organizational domain."
  • 421 5.7.32: "Your email was blocked because the From: header (RFC5322) in this message isn't aligned with either the authenticated SPF or DKIM organizational domain."

The second is listed with reply code 421, a temporary reply, although its text says the email was blocked. Gmail's sender guidelines give the rule: "For direct email, the domain in the sender's From: header must be aligned with either the SPF domain or the DKIM domain." The FAQ adds: "Although we require bulk senders to set up both SPF and DKIM authentication, only one of these needs to be aligned to meet the sender alignment requirements." and "DMARC alignment isn’t required for forwarded or mailing list messages".

Google's DMARC help defines relaxed alignment, the default: for SPF, "The domain in the header From: address must match or be a subdomain of the domain in the Envelope-Sender (also called Return-Path or bounce) address." For DKIM, "The domain in the header From: address must match or be a subdomain of the domain specified in the DKIM signature d= tag." So the error appears when a sending service signs with its own d= domain and uses its own bounce domain: both pass, but for the service's domain, not yours. See SPF passes but DMARC fails for the same problem in DMARC reports.

Sources

All findings