Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 2 min read

Gmail 550 5.7.26: how to fix DMARC alignment

Gmail answers some messages with 550 5.7.26. Google's documentation says messages that fail authentication may be rejected with a 5.7.26 error. In practice the sender's domain has a DMARC policy, and the message passed n

Gmail answers some messages with 550 5.7.26. Google's documentation says messages that fail authentication may be rejected with a 5.7.26 error. In practice the sender's domain has a DMARC policy, and the message passed neither SPF nor DKIM in alignment with the From address.

What alignment means

DMARC (RFC 7489) does not only ask "did SPF or DKIM pass?". It asks whether the domain that passed matches the domain in the visible From: header. Google puts it this way for bulk senders: the From domain must be aligned with either the SPF domain or the DKIM domain.

  • SPF alignment: the envelope sender (Return-Path) domain matches the From domain.
  • DKIM alignment: the d= domain in the DKIM signature matches the From domain.

Only one of the two needs to align. Relaxed mode (the default) accepts a subdomain of the same organizational domain; strict mode (adkim=s, aspf=s) requires an exact match.

Step 1: read the real result

Send a test to a Gmail address, open the message, choose "Show original" and read:

Authentication-Results: mx.google.com;
  dkim=pass header.i=@yourdomain.com
  spf=pass smtp.mailfrom=yourdomain.com
  dmarc=pass header.from=yourdomain.com

If dkim=pass shows a header.i of your email provider (for example @mailer.provider.net), the signature passes but is not aligned.

Step 2: check your DNS

dig TXT _dmarc.yourdomain.com +short
dig TXT yourdomain.com +short | grep spf1
dig TXT selector1._domainkey.yourdomain.com +short

Replace selector1 with the selector shown in the s= tag of the DKIM-Signature header.

Step 3: fix the cause

  1. Third-party sender (newsletter tool, CRM, invoicing): enable "custom domain" or "domain authentication" in its settings. It gives you CNAME or TXT records that make it sign with d=yourdomain.com. This is the most robust fix.
  2. SPF passes on the wrong domain: the provider uses its own Return-Path. Either configure a custom return-path domain, or rely on aligned DKIM instead.
  3. DKIM key missing or too short: Google asks for at least 1024 bits and recommends 2048 bits when your provider supports it.

Keep a single SPF record (v=spf1 once) and stay under 10 DNS lookups.

Step 4: retest

Wait for DNS propagation, send again, and confirm dmarc=pass in the header.

Check your own domain

If you would rather not run these commands by hand, there is a free check at https://attackscout.com/en?utm_source=devto&utm_medium=article

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.