How to Fix Gmail 550 5.7.26 SPF Hard Fail Errors
Question details
The user needs to resolve an email delivery rejection issue where Gmail blocks messages sent from their domain with a 550 5.7.26 SPF error.

- Product
- Microsoft 365 / Third-party mail server
- Device & OS
- not provided
- Scenario
- Sending emails to Gmail recipients using a domain that routes mail through both Microsoft 365 and a third-party mail gateway.
- Observed behavior
- Gmail rejects the sent messages with a 550 5.7.26 SPF Hard Fail error because the third-party sender's IP address is not authorized in the domain's SPF record.
Ensure you have administrative access to your domain's DNS management portal and a complete list of all public IP addresses or include mechanisms for the third-party mail providers your organization uses.
Update the Domain's Single SPF TXT Record
Modify your existing SPF record to authorize all legitimate sending services, including both the third-party gateway and Microsoft 365, on a single line.
To prevent authentication failures, a domain must only have one SPF TXT record. If your organization uses multiple sending services like Microsoft 365 and another gateway, you must merge them into this single record.
Be mindful of the SPF DNS lookup limit (a maximum of 10 nested lookups). Exceeding this limit will cause email rejections even if the syntax is otherwise correct.
Log in to the control panel of your domain registrar or DNS hosting provider and navigate to the DNS records management section.
Find the TXT record that begins with 'v=spf1'. Do not create a new TXT record if an SPF record already exists.
If not already present, insert 'include:spf.protection.outlook.com' into the record to ensure Microsoft 365 emails pass authentication.
Insert the required IP addresses or include statements for your third-party mail server (e.g., 'ip4:AUTHORIZED_IP' or 'include:AUTHORIZED_PROVIDER').
Ensure the entire record is written on one single line, ending with '~all' or '-all'. For example: 'v=spf1 ip4:192.0.2.1 include:spf.protection.outlook.com include:thirdparty.com ~all'. Save your changes.

Enhance Your Daily Workflow with WPS Office
While troubleshooting domain DNS and Microsoft 365 delivery issues, streamline your document creation with WPS Office. It provides a free, fast, and highly compatible alternative to Microsoft Office for all your business needs.

Frequently Asked Questions
Can I have multiple SPF records for my domain?
No. Having more than one SPF TXT record for a single domain will cause SPF checks to fail permanently. You must consolidate all authorized IP addresses and 'include' mechanisms into one single line.
Does the order of items in an SPF record matter?
The order of mechanisms generally does not matter for the final authentication result, but processing stops at the first match. To optimize performance, it is recommended to place the most frequently used IP addresses or mechanisms closer to the beginning.
How do I know if my updated SPF record is working correctly?
After updating the record in your DNS settings, wait for the changes to propagate. Then, send a test email to a Gmail account, open the message options, and view the original message headers to verify that the SPF status says 'PASS'.




