Made with Gila CMS

Fix Undelivered Mail Returned to Sender for

Posted on September 1, 2022

Gmail was responding with this message everytime I wanted to send an email on gmail account.

The MAIL FROM domain [] has an SPF record with a hard
    fail 550-5.7.26 policy (-all) but it fails to pass SPF checks with the ip:
    550-5.7.26 []. To best protect our users from spam and
    phishing, 550-5.7.26 the message has been blocked.

So, what you have to do, is to make sure you setup corrctly your SPF and DKIM on your DNS. They are both needed so gmail wont reject your emails.

SPF Records

Create a TXT record with one of these values

v=spf1 ~all

if you also use sendgrid for emails, then:

v=spf1 ip4: ~all

You can generate or test your SPF record in these links:

DKIM Records

1. Use DKIM key generator. For example

2. Add the public key as a TXT record on the domain's DNS zone file. With subdomain <Selector>._domain key and value v=DKIM1;t=s;p=......

3. Log into the MAC and search for the domain in the top left. On the domain overview page you will see a "DKIM" section, click to expand. In the DKIM section there are two fields: Selector and Key. Enter the selector you set for the domain and paste the private key into the key field.