mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.
https://mailinabox.email/
Creative Commons Zero v1.0 Universal
14.06k stars 1.44k forks source link

hostname example.host.tld does not resolve to address xxx.xxx.xxx.xxx #2357

Open konstanzzz opened 10 months ago

konstanzzz commented 10 months ago

This issue occurs when the sending server has both IPv4 and IPv6.

postfix/smtpd[355662]: warning: hostname example.host.tld does not resolve to address xxx.xxx.xxx.xxx

When this happens, rDNS check also fails:

X-Spam-Report: 
[...]
    *  0.8 RDNS_NONE Delivered to internal network by a host with no rDNS
[...]

Received: from example.host.tld (unknown xxx.xxx.xxx.xxx)

Specifying RESOLV_MULTI in /etc/postfix/main.cf solves the issue as suggested here.

import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY LANG=C RESOLV_MULTI=on

Can we add this to the default config generated by Mail-in-a-Box?

solomon-s-b commented 10 months ago

As per the link you refer to, there are two options to resolve this problem. The one you suggested, and the other is to add "multi on" to "/etc/host.conf" file.

According to Debians reference manual here, the setting in "/etc/host.conf" is already there.

Ubuntu is based on Debian therefore it inherits most of its default settings from Debian including the "/etc/host.conf" settings.

I've checked to see if on my MiaB server (Ubuntu 22.04) that setting is present, and it does.

I then checked if it returns multiple IP addresses using the "host" command against the following domain names:

host google.com

google.com has address 142.251.40.142
google.com has IPv6 address 2607:f8b0:4006:820::200e
google.com mail is handled by 10 smtp.google.com.
host yahoo.com

yahoo.com has address 74.6.143.26
yahoo.com has address 98.137.11.163
yahoo.com has address 74.6.231.21
yahoo.com has address 74.6.143.25
yahoo.com has address 98.137.11.164
yahoo.com has address 74.6.231.20
yahoo.com has IPv6 address 2001:4998:24:120d::1:1
yahoo.com has IPv6 address 2001:4998:44:3507::8001
yahoo.com has IPv6 address 2001:4998:124:1507::f001
yahoo.com has IPv6 address 2001:4998:124:1507::f000
yahoo.com has IPv6 address 2001:4998:44:3507::8000
yahoo.com has IPv6 address 2001:4998:24:120d::1:0
yahoo.com mail is handled by 1 mta6.am0.yahoodns.net.
yahoo.com mail is handled by 1 mta7.am0.yahoodns.net.
yahoo.com mail is handled by 1 mta5.am0.yahoodns.net.
host linode.com

linode.com has address 72.14.191.202
linode.com has address 69.164.200.202
linode.com has address 72.14.180.202
linode.com has IPv6 address 2600:3c00::22
linode.com has IPv6 address 2600:3c00::12
linode.com has IPv6 address 2600:3c00::32
linode.com mail is handled by 10 mxa-00190b01.gslb.pphosted.com.
linode.com mail is handled by 10 mxb-00190b01.gslb.pphosted.com.

As you can see, from the outputs above, it definitely returns multiple IP addresses.

Can you please check against your server to see if the "multi on" setting in /etc/host.conf is present.

konstanzzz commented 10 months ago

Can you please check against your server to see if the "multi on" setting in /etc/host.conf is present.

Hi,

I checked it prior to modifying main.cf. multi on was already present yet the issue was only resolved by adding the line mentioned in the second option.

solomon-s-b commented 10 months ago

While digging into this subject, I found out that one of my mail servers had a misconfigured rDNS IPv6 record. so, thanks to you, now it's fixed.

Regarding the other email headers containing the: "RDNS_NONE Delivered to internal network by a host with no rDNS"

In my case, all of them were legit spam scores as they really didn't resolve to a PTR (rDNS) record or the IP address didn't match the one postfix got from the client.

My question is, are the unresolved domain names in your /var/log/mail.log file ones you expect to get email from and if so, could it be that at their end there is a misconfigured DNS record?

Also I found an old post on MiaB forum here, it appears that they aren't concerned about it.

konstanzzz commented 10 months ago

My question is, are the unresolved domain names in your /var/log/mail.log file ones you expect to get email from and if so, could it be that at their end there is a misconfigured DNS record?

The sending domains are under my control as well and their DNS and PTR records are properly configured.