r-raymond / nixos-mailserver

A complete and Simple Nixos Mailserver
GNU General Public License v3.0
181 stars 27 forks source link

Allow possibility to not use a hostPrefix #11

Closed phdoerfler closed 6 years ago

phdoerfler commented 7 years ago

Testing mailing with mail-tester.com I get the following warning:

Your reverse DNS does not match with your sending domain. Reverse DNS lookup or reverse DNS resolution (rDNS) is the determination of a domain name that is associated with a given IP address. Some companies such as AOL will reject any message sent from a server without rDNS, so you must ensure that you have one. You cannot associate more than one domain name with a single IP address.

This is because my reverse DNS resolves to example.com, but the mail was sent from mail.example.com. Apparently some services like AOL take offence to that and treat mail as spam or bounce it.

Whilst it is neat to have a mail.example.com, it would require having multiple IP addresses to work correctly with mail providers, one for the TLD and one for each subdomain. At least according to mail-tester.com. Please

However, simply using hostPrefix = ""; results in a bunch of errors relating to .example.com not being a valid domain.

The most feasible thing might be to use a lib.optional to make the hostPrefix optional for those who are worried about their reverse DNS.

Thoughts?

r-raymond commented 7 years ago

Whilst it is neat to have a mail.example.com, it would require having multiple IP addresses to work correctly with mail providers, one for the TLD and one for each subdomain. At least according to mail-tester.com.

Note that your rDNS entry has to be set correctly, but the FQDN does not have to match the sending address. Let's say you have the domains a.com and b.com and a server with correct DNS and rDNS entry at mx.c.com. You can use that to send and receive emails for addresses from both a.com and b.com (i.e. as soon as we have multiple domains :) as long as you set a mx record to mx.c.com for both a.com and b.com.

Generally speaking you should absolutely make sure that your rDNS is set correctly. Assuming you can't / don't want to set it to mail.example.com, this needs to be addressed.

I'll try to write a small tutorial how to set up a server to get the 10/10 on mail-tester as soon as I find some time. If you want to contribute, any help is greatly appreciated.

Others have mentioned that the hostName should be set manually, which is fine but can lead to subtle problems when postfix dovecot assume the hostName is set correctly. This would need additional testing to implement.

r-raymond commented 6 years ago

This should be addressed by the multiple domain extension. You can now specify fqdn = whatever.you.like; independent of the host name