Gmail SPF Checks/Failures
Since February 2024, Google has required senders to authenticate their mail, and messages from domains that fail those checks can be rejected outright rather than sent to spam.
The SPF record helps stop spoofed emails by confirming (through a DNS (TXT) record) that the server that has been used to send an email is one that is authorised to send messages on behalf of that domain.
v=spf1. If there are two, SPF fails permanently for every message you send - which is worse than the problem you started with.You will already have one if you use Microsoft 365, Google Workspace, Mailchimp or any other mail service. In that case do not add a second record: edit the existing one and add
include:relay.k.io to it, keeping everything that is already there.To add or edit the record you need your domain's DNS. If you are unsure how, please review the following guide first: Managing DNS using cPanel Zone Editor
Once you have familiarised yourself with the DNS editor, please review the required TXT/SPF record below:
v=spf1 include:relay.k.io ~all
That is the whole record. All mail leaving our servers is sent through MailChannels, so include:relay.k.io covers everything - you do not need to add your server's IP address, and you don't need to go and look it up.
If your existing record already contains an +ip4: entry for your server, you can leave it there - it does no harm, and there is no need to edit a working DNS record just to remove it.
Once the record has been added, it may take up to 24 hours for the DNS to propagate.
If mail to Gmail still bounces
SPF is only one of the checks Google makes, so read the bounce message itself - it names the reason as a code:
5.7.27- the message failed SPF. The record above is what you need.5.7.26- the message was not authenticated at all. SPF or DKIM will satisfy this.5.7.30- the message failed DKIM. SPF will not fix this one.5.7.25- the sending IP has no reverse DNS (PTR) record. Contact us if you see this.
If you send in volume to Gmail, Google also expects DKIM and a DMARC record, not just SPF. Our guide to improving mail deliverability with SPF, DKIM and DMARC covers setting all three up, including cPanel's Email Deliverability tool, which can generate them for you.