Postfix – Reverse DNS (PTR) EHLO Mismatch

postfix

I'd like to run my own email server, but yikes! It's so hard, it's as if email configuration is the latin/greek of the internet..

Okay,

My ISP set up a reverse dns DNS (PTR) entry for mx.[mydomainname].com

Per advice online I changed smtpd_banner = mx.[mydomainname].com ESMTP in
/etc/postfix/main.cf.

But when I test my email server with http://xeams.com/validation.htm

Still it tells me that the reverse lookup fails.

Reverse Lookup: FAIL Connecting IP resolves to mx.[mydomainname].com,
which does not match with HELO string

Also I've checked the EHLO message using telnet [mydomainname].com 25 to verify that it contained the specific reverse lookup mx.[mydomainname].com, tried again after editing it to match exactly.

Each time after rerunning the validation report it says the same thing.

Reverse Lookup: FAIL Connecting IP resolves to mx.[mydomainname].com,
which does not match with HELO string

— this is perplexing and if anyone can help I'd appreciate it.


Update


After editing my config so that my hostmane in postfix is mx.[mydomainname]

And trying also when hostname in postfix is [mydomainname]

Ensuring to reload and with

DNS record config:

  • A |[mydomainname] | [my.static.ip.address]
  • A |mx.[mydomainname]| [my.static.ip.address]
  • MX |mx.[mydomainname] | [mydomainname]
  • TXT |mx.[mydomainname] | v=spf1 a mx ~all
  • TXT |mail._domainkey.[mydomainname] | v=DKIM1; k=rsa; p=…keycode

Both cases I'm getting this bounce back when I try to do the validation test…

<validate.server@synametrics.com>: host mailbk.synametrics.com[74.208.84.194]
    said: 550 5.1.1 <validate.server@synametrics.com>... User unknown (in reply
    to RCPT TO command)

I'm not sure if I need give the MX records I edited time to propagate. If the DKIM set to mail. is a problem, or what kind of trouble I'm in.

Best Answer

That was a wrong advice.

smtpd_banner, as it is clear from the name, configure Postfix's smtpd server processes. It it the server processes, which listen to incoming connections on port 25, and probably on other ports if you enabled them (like submission service).

What you need is set up how postfix smtp client process introduces itself when it connects to another system to their port 25 (or another port if you configured it so in transport_maps). The value it uses for that is smtp_helo_name which by default is set to myhostname.

I advise to change myhostname, because it is used in many places as a template. That way it will affect many other settings in the right way. For example, smtpd_banner by default also depends on it and will be set in sync with other settings.

UPD: by the way, Postfix manual (man 5 postconf) also says about smtpd_banner:

You MUST specify $myhostname at the start of the text. This is required by the SMTP protocol.

this also could have directed you to the idea that original advice was strange and you have to do something with myhosname. Always check other's advices with manual. Mine too!