How do I resolve SMTP banner issues?
I am setting up a mail server, but my email is being rejected because my SMTP banner does not match my reverse DNS. Can you help me understand the issue and solve my problem?
1 Reply
Understanding SMTP Banners
If you were to login to your mail server manually using telnet, instead of using a mail program, you normally get a message followed by a prompt from which you can enter commands to your mail server.
# telnet 192.0.2.135 25
Trying 192.0.2.135...
Connected to mail.example.com.
Escape character is '^]'.
220-li9999-999.members.linode.com ESMTP Exim 4.92 #2 Mon, 09 Sep 2019 19:33:03 +0100
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
421 li9999-999.members.linode.com: SMTP command timeout - closing connection
Connection closed by foreign host.
Understanding rDNS
DNS is a way to assign human readable name, i.e. name.example.com and associate it with a network address. It is hierarchical, which means the people responsible for a TLD or Top Level Domain (.com in this example) can delegate a subdomain to someone else. Domain registrars (the people from whom you buy domains) arrange this for you. In theory, you can delegate control of your subdomain to other people as well.
rDNS is a way of looking up the name of a network address. It works in reverse to DNS which provides the network address given a name. rDNS is maintained by whomever is responsible for the network addresses they control. Linode maintains the rDNS records for the IP addresses assigned to Linodes and you can use the Linode Cloud Manager to assign the name of the IP address assigned to your Linode.
Why does the SMTP Banner need to match the rDNS
When you send mail to someone, they want to know that the mail is actually coming from you, so if you lookup a domain, mail.example.com and get 192.0.2.135, when they connect to a server at that address, they will want to see the server announce itself as mail.example.com, otherwise the mail can be flagged as suspicious and sent to your recipients spam folder or rejected altogether.
In the misconfigured example above, the Linode is responding with it's default rDNS and not the name it was assigned in DNS.
You can set the rDNS by following these instructions:
You can set what your Linode thinks that its name by following the instructions here which are different depending on your Linux distribution:
Most mail servers will use the hostname of the server as the banner for SMTP, but if they do not you will want to manually configure your mail server to use the name that is setup in rDNS.