4

Why is this question closed? There are hundreds of SPF record questions on StackOverflow that are not closed, why this one?


My environment: hMailServer 5.6.8 on Windows Server 2022 Standard

Let's say I have two domains (I don't really own these domains, they're just examples), www.myblog.com and www.mailserver.com. They are both hosted on the same machine and have the same IP address 1.2.3.4.

The blog site www.myblog.com uses www.mailserver.com to send emails. The site www.mailserver.com only serves as a mail server; it is not accessible from a browser. I have set it up so that when www.myblog.com sends an email to someone, the recipient's email server receives SENT: EHLO www.mailserver.com, but sees SENT: MAIL FROM:<noreply@myblog.com> message, so the recipient sees that the email came from myblog.com.

Everything is working fine so far. Recently I decided to check the "spam rating" of my setup at https://www.mail-tester.com. I sent an email to the spam tester using the setup described above, and I saw a warning under the SpamAssassin section that says

SPF_HELO_NONE        SPF: HELO does not publish an SPF Record

My question is, how do I get rid of this warning? Are the DNS records as they should be? See below for the DNS records for each domain.

enter image description here

The DNS records for each domain are as follows (note the PTR record for 1.2.3.4):

IP address 1.2.3.4
PTR www.mailserver.com

myblog.com
Name            Type    Value
@               A       1.2.3.4
*               A       1.2.3.4
@               MX      10 myblog.com.
@               TXT     v=spf1 ip4:1.2.3.4 ~all
dkim._domainkey TXT     v=DKIM1; t=s; k=rsa; p=[super long public key string]

mailserver.com
Name            Type    Value
@               A       1.2.3.4
*               A       1.2.3.4
@               MX      10 mailserver.com.
@               TXT     v=spf1 ip4:1.2.3.4 ~all
user3163495
  • 2,425
  • 2
  • 26
  • 43
  • Fixing this will have no effect on your spam score (it is already greater than -0.5). – Robert Harvey Apr 07 '22 at 18:09
  • @RobertHarvey I know it's a very insignificant warning, but I want to know what it means so I understand SPF and DNS better – user3163495 Apr 07 '22 at 18:15
  • https://serverfault.com/q/1064046 – Robert Harvey Apr 07 '22 at 18:16
  • @RobertHarvey I've seen that question before, but the question (and answer) doesn't clarify what to do in my particular setup. What specific DNS records and values do I add/change? I listed the DNS records in my question. What changes do I make? – user3163495 Apr 07 '22 at 18:18
  • Have you published SPF records for your HELO/EHLO hostnames, as that post describes? – Robert Harvey Apr 07 '22 at 18:36
  • Also, did you try [this](https://serverfault.com/a/1064047/12923)? – Robert Harvey Apr 07 '22 at 18:37
  • @RobertHarvey Apparently I haven't published SPF records for my HELO/EHLO hostnames, or else I wouldn't be getting the error. What do I do to publish them? – user3163495 Apr 07 '22 at 18:39
  • @RobertHarvey I cannot try that solution to the question because I'm not using postfix. – user3163495 Apr 07 '22 at 18:39
  • The two options presented in that duplicate are the only options open to you. Every mail server will have some config option to do that, so go read the docs for it. It's likely you don't need to change DNS at all, only the HELO name of your mail server to match your sending domain (which already has an SPF) – but the fact that it's happening at all suggests that the current HELO name is *not* the same as your MAIL FROM domain, so double-check how your mail server introduces itself to others. – Synchro Apr 07 '22 at 18:42
  • @Synchro currently, I'm using hMailServer, and the EHLO message it is sending is "SENT: EHLO www.mailserver.com", and if I change it to anything else, I will get spam warnings saying that my EHLO domain doesn't match mailserver.com's PTR record – user3163495 Apr 07 '22 at 18:44
  • 2
    From the email tag: Use this tag for questions involving code to send or receive email messages. Posting to ask why the emails you send are marked as spam is off-topic for Stack Overflow. Questions about configuration of mail servers belong on Server Fault. – Rob Apr 07 '22 at 18:49
  • @Rob Can you move my question to ServerFault or do I need to re-write it? – user3163495 Apr 07 '22 at 18:50
  • I don't have that ability. – Rob Apr 07 '22 at 18:51
  • You're not getting some mix-up between `www.mailserver.com` and plain `mailserver.com`, since you don't list an SPF for the bare domain? It's common to have a hostname on the mail server and not on the MAIL FROM address, and that would be matched by a DMARC `aspf=r` policy, but you'd still need SPF records for both. – Synchro Apr 07 '22 at 18:53
  • 1
    You can click on "edit", copy it from there, and paste over on ServerFault. Make sure you delete this one. – Rob Apr 07 '22 at 18:55
  • Its not a programming question and should be on ServerFault or WebMasters – Rohit Gupta Jul 25 '23 at 05:17

1 Answers1

6

I was able to get rid of the warning by adding an extra TXT record with the name "www" to the www.mailserver.com DNS:

mailserver.com
Name            Type    Value
@               A       1.2.3.4
*               A       1.2.3.4
@               MX      10 mailserver.com.
@               TXT     v=spf1 ip4:1.2.3.4 ~all
www             TXT     v=spf1 ip4:1.2.3.4 ~all <-- adding this record fixed the warning
user3163495
  • 2,425
  • 2
  • 26
  • 43