Fix Undelivered Mail Returned to Sender for hosteddomain.com
Gmail was responding with this message everytime I wanted to send an email on gmail account.
The MAIL FROM domain [gilacms.com] 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 [188.8.131.52]. 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.
Create a TXT record with one of these values
v=spf1 include:_spf.hostedemail.com ~all
if you also use sendgrid for emails, then:
v=spf1 ip4:184.108.40.206/24 include:_spf.hostedemail.com include:u10379184.wl185.sendgrid.net ~all
You can generate or test your SPF record in these links:
1. Use DKIM key generator. For example https://easydmarc.com/tools/dkim-record-generator
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.