Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

Gmail 550 5.7.26: the sender is unauthenticated. Publish SPF or DKIM that matches the mail

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

When Gmail answers 550 and 5.7.26, it has refused the message because authentication failed. The page "Gmail SMTP errors and codes" gives three different texts under that code. Read the one in your bounce before you change DNS. All senders must set up SPF or DKIM. Senders of more than 5,000 messages a day to Gmail accounts must set up SPF, DKIM and DMARC. The guidelines say messages that are not authenticated with these methods might be marked as spam or rejected with a 5.7.26 error.

Gmail appends gsmtp to errors, and gcdp when a Google Workspace administrator's own rule produced the error. A gcdp suffix is that custom rule, not the three texts below.

What the symptom means

These three texts are copied from the Gmail SMTP errors page.

The first is an authentication miss:

This email has been blocked because the sender is unauthenticated. Gmail requires all senders to authenticate with either SPF or DKIM. Authentication results: DKIM = did not pass SPF [domain-name] with ip: [ip-address] = did not pass. For instructions on setting up authentication, go to Email sender guidelines.

The second is an SPF hard fail. The domain published -all, and the sending address did not pass:

The (E)MAIL FROM domain [domain-name] has an SPF record with a hard fail policy (-all) but it fails to pass SPF checks with the ip: [ip-address]. To best protect our users from spam and phishing, the message has been blocked. For more information, go to Email sender guidelines.

The third is the domain's own DMARC policy:

Unauthenticated email from domain-name is not accepted due to domain's DMARC policy. Contact the administrator of domain-name domain if this was legitimate email. To learn about the DMARC initiative, go to Control unauthenticated email from your domain.

SPF is a TXT record at the sending domain that lists who may send. DKIM is a signature the receiving server checks against a key you publish. DMARC, in the sender guidelines, tells receiving servers what to do with messages that do not pass SPF or DKIM. To pass DMARC, the message must be authenticated by SPF or DKIM, or both, and the authenticating domain must be the same domain that appears in the From: header. RFC 7489 stores that policy as a TXT record at _dmarc under the domain, and the policy values are none, quarantine and reject.

Likely causes

Cause What you see How to confirm
No SPF record, and no DKIM signature that passes First 5.7.26 text, both results "did not pass" dig txt the domain. The guidelines require SPF or DKIM for every sender
The envelope domain has SPF -all and this server is not in the record Second 5.7.26 text, naming the domain and the IP Compare the IP in the bounce with the SPF record
The domain publishes a DMARC policy and neither SPF nor DKIM is aligned with the From: domain Third 5.7.26 text Query _dmarc and read p=
A bulk sender has SPF or DKIM but not both, or has no DMARC record 5.7.26 after volume grew past the bulk threshold Guidelines: bulk senders need SPF, DKIM and DMARC. The DMARC policy can be none

Prove the cause before changing anything

All of these are read-only.

1. Copy the bounce text. Keep the domain name and the IP address Gmail printed. The three 5.7.26 texts name different faults.

2. Read the SPF record. The dig manual's TXT example is:

dig txt example.com

The sender guidelines say the SPF record should include all email senders for the domain. Write down every TXT answer. The sending IP in the bounce has to be covered by that record.

3. Read the DMARC record. RFC 7489 shows this query:

dig +short TXT _dmarc.example.com.

The policy tag is p=, and the allowed values are none, quarantine and reject. What each value asks a receiver to do is covered in the guide to reading a DMARC fail result.

4. Check alignment, not only a pass. For direct mail from a bulk sender, the guidelines require the domain in the From: header to be aligned with either the SPF domain or the DKIM domain. A pass on a different domain still fails that test.

Fix

Fix the check the bounce named. Do not weaken -all to hide a server that should have been listed.

Save the current records first. Run these two commands against the sending domain from the bounce. Each writes its own file, so a later save never overwrites an earlier one:

dig txt <sending-domain> > spf-before.txt
dig +short TXT _dmarc.<sending-domain> > dmarc-before.txt

If DKIM is already switched on, also save its key record. Use the selector that your mail system or provider gives for the existing key:

dig +short TXT <selector>._domainkey.<sending-domain> > dkim-before.txt

If DKIM has never been switched on, there is no key record to save.

Risk: the next step changes the SPF, DKIM and DMARC records of the sending domain in its DNS zone. Receivers cache TXT records. A wrong SPF record makes legitimate mail fail SPF, a wrong or missing DKIM key makes signed mail fail DKIM, and a DMARC p=reject then turns those failures into a block at every receiver that honours it, not only at Gmail.

In the DNS console for the zone the registrar delegates, edit the SPF record that already exists so that it also includes the server named by the IP in the bounce. RFC 7208 section 4.5 says: "If the resultant record set includes more than one record, check_host() produces the "permerror" result." So publish one SPF record, not a second one. If the domain has no SPF record, create one.

If the bounce says DKIM did not pass, turn on DKIM for the domain that sends the mail. The sender guidelines say: if you use Google Workspace to send email, turn it on there; if you do not, use one of the available internet tools to create DKIM keys, or check with your domain provider for help. Then publish the public key at the name the tool or provider gives you.

For a bulk sender, also publish a DMARC record. The guidelines say the enforcement policy can be none while you confirm mail passes. The record name is _dmarc under the domain, as RFC 7489 section 6.1 describes.

To undo it: if spf-before.txt shows a v=spf1 record, publish that saved text again in the SPF record you edited. If it shows none, delete the SPF record you created. Do the same for dmarc-before.txt and, if you saved one, dkim-before.txt: publish the saved text again when the file holds a record, and delete the record you published when the file is empty. If you never saved dkim-before.txt, DKIM was off before, so delete only the DKIM key record you published.

Example (illustrative): mail from notices.example.com is sent by 198.51.100.20. Gmail returns the first 5.7.26 text and names that IP. dig txt notices.example.com shows an SPF record that lists only 203.0.113.10. The administrator adds the sending host to that one record, turns on DKIM for notices.example.com, and leaves DMARC at p=none until a test message shows a pass.

Confirm the fix

  1. Repeat the two TXT queries. The new SPF record is the only SPF record at that name, and it includes the sending server.
  2. Send one message from the same server, to a Gmail mailbox, with the same envelope domain and the same From: domain.
  3. Read the new bounce if it is still rejected. A remaining 5.7.26 should name the check that still fails. A 5.7.25 is a PTR problem, covered separately.

What to watch afterwards

  • Add a sender to the SPF record before that sender goes live. The guidelines say third-party senders that are not included are more likely to be marked as spam.
  • Keep the DKIM key at 1024 bits or longer for mail to personal Gmail accounts. The guidelines recommend 2048 bits when the DNS provider supports it.
  • If you regularly forward email or manage a forwarding service, the guidelines say to help ensure forwarded messages are authenticated by following Gmail's page on forwarding email to Gmail. For direct email, the domain in the From: header must be aligned with the SPF domain or the DKIM domain.
  • When you add another include to SPF, check the record again. A record that no longer describes the sending server produces the second 5.7.26 text if it ends in -all.

Risks and limits

  • Gmail's wording can change. Match the text on the current SMTP errors page.
  • DMARC p=none does not ask receivers to reject. It still reports a failure when SPF and DKIM do not produce an aligned pass. RFC 7489 defines that result as fail.
  • The guidelines for more than 5,000 messages a day are stricter than the rule for every sender. A small sender can pass with SPF or DKIM and still be rejected later, after volume grows, if DKIM or DMARC is missing.

Sources