-3

I use Postfix/Dovecot for my emails. They work together well. Now I have a server with multiple IP addresses, and I want to host each IP address with a domain for mails. But it seems Postfix and Dovecot are reading their configuration files from /etc/postfix and /etc/dovecot respectively. Should I run multiple instances of Postfix and Dovecot? And how about the mail data? They seem to be stored in each user's home directory and /var/spool/mail?

Any great tutorial link would be greatly appreciated.

1 Answer 1

8

It is not really necessary to use one IP address per domain, both Postfix and Dovecot (and the DNS system) are perfectly capable of handling a practical unlimited amount of domains with only one IP.

Even if you do use only one domain per IP, you would usually still run only one instance of Postfix/Dovecot and configure them accordingly to handle mails for all domains.

Furthermore, both Postfix and Dovecot can use a wide range of sources for users, from the default in the form of the unix system user to text files, SQL databases or LDAP directories, and you can configure per domain or even per user where the mail should be stored.

How this is done is way too broad to answer on SF.


Regarding PTR records: You are correct that one IP can only have a single PTR record, but that is actually OK.

What is important is that the mail server uses the same hostname as in the PTR record in its HELO message (as set in the postfix myhostname parameter), so the triple of PTR record, A record and HELO name must be the same.

For the pure SMTP part, this is entirely sufficient. Spam filters make the situation more complex, as they will indeed add a small penalty to such a setup if the FROM address and the HELO doesn't match, but that alone is usually not enough to classify a mail as spam.

This can be counteracted by different means:

  • Use mail.example.com as MX for example.org. This is checked by spam filters.
  • Add SPF records that authorize mail.example.com to send mails on behalf of example.org.
  • Use DKIM.

So, in the end, it stills stands: One IP address is enough for multiple mail domains, and using more than one is only is only useful if you have more complicated setups with multiple NICS or even servers in a HA scenario, but even then you would likely not separate domains to specific IP addresses.

2
  • But you can only assign one rNDS to one IP, AFAIK, you have to set correct rDNS to the IP in order for the mail to work.
    – Qian Chen
    Jul 22, 2015 at 12:36
  • See my edit for more info.
    – Sven
    Jul 22, 2015 at 13:27

Not the answer you're looking for? Browse other questions tagged .