SpamAssassin adds SPF_HELO_NONE to mail sent from your Postfix server
SPF_HELO_NONEShort answer
The receiver checked SPF for the name your server gave in HELO and found no record. Two things cause that: the HELO name is a short or local name that is not a full domain, or the full name has no SPF record. Set a real hostname in Postfix and publish a TXT record for it.
Fix it fast
1Find out which cause you have
Find out which name Postfix puts in HELO, then see whether DNS has a TXT record for it.
postconf myhostname smtp_helo_name dig +short TXT mail.example.com2Match what you see, then jump to its fix
What does the error look like?
SPF_HELO_NONEX-Spam-Status lists SPF_HELO_NONE even though SPF for your From domain passes
Cause 1 of 2
The HELO name is not a full domain name
1Check
RFC 7208 says the HELO check only applies when the HELO string is a valid multi-label domain name. For anything else the result is none. smtp_helo_name defaults to myhostname, which defaults to the machine's fully qualified name from gethostname().
hostname -f
postconf myhostname smtp_helo_name2Fix
Give the machine a fully qualified name that exists in DNS and use it for myhostname, or set smtp_helo_name on its own.
sudo postconf -e 'myhostname = mail.example.com'
sudo postconf -e 'smtp_helo_name = mail.example.com'
sudo systemctl reload postfix3Verify
Confirm both settings show the full name.
postconf myhostname smtp_helo_nameConfirmed by rfc-editor.org
Cause 2 of 2
The HELO name has no SPF record in DNS
1Check
RFC 7208 says the HELO identity is checked on its own, and that a lookup which finds no domain (NXDOMAIN) gives the result none. A record must exist at the HELO name itself, not only at the From domain.
dig +short TXT mail.example.com2Fix
Publish an SPF TXT record at the HELO name itself. The a mechanism authorises the address the name points to, and -all rejects everything else.
mail.example.com. IN TXT "v=spf1 a -all"3Verify
Wait for DNS to update, then query the record again and send a test message.
dig +short TXT mail.example.comConfirmed by rfc-editor.org
How do I stop it coming back?
- Use one hostname for the server's A record, reverse DNS, myhostname and the HELO name.
- Add the HELO-name SPF record when you add a new mail server, not after the first spam score.
- Keep the SPF record for your sending domain as well; the HELO record does not replace it.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Mail from your own domain keeps landing in the spam folder
dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=example.com
Open a message that went to spam and read its Authentication-Results header: it shows whether SPF, DKIM and DMARC passed, and for which domain.
5 causes, each with a fixDovecot refuses to start: Can't load SSL certificate, no valid PEM certificate
doveconf: Error: ssl enabled, but ssl_cert not set
Dovecot reads the ssl_cert setting as the file's contents, not a path, so in 2.3 the value must start with a less-than sign.
3 causes, each with a fixOutlook.com bounces your mail with 550 5.7.515
status=bounced (host hotmail-com.olc.protection.outlook.com[...] said: 550 5.7.515 Access denied
550 5.7.515 means Outlook.com counts your From domain as a high-volume sender (5,000 or more messages a day to Microsoft consumer addresses) and the message failed its authentication rules.
4 causes, each with a fixPostfix refuses to send with "Relay access denied"
454 4.7.1 <user@example.net>: Relay access denied
Postfix says Relay access denied when a client asks it to deliver to a domain it does not host, and the client is neither listed in mynetworks nor logged in with SASL.
5 causes, each with a fixPHP mail() returns true but the email never arrives
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing
mail() returning true only means the message was accepted for delivery, not that it arrived.
4 causes, each with a fixCodeIgniter email does not send and shows no error message
$email->printDebugger() prints an empty result
CodeIgniter signals a failed email only by send() returning false, with no exception.
4 causes, each with a fix