# Postfix multi-domain mail server - jails or virtual domains?



## nitin (Nov 26, 2016)

Hello folks!

I am just getting started to setup a new mail server running FreeBSD 11. I need to setup 4 domains on this server. I am using Postfix as the MTA, Dovecot for Imap/Pop, Amavisd, Spamassassin, Postgrey & Clamav for filtering messages. 

Initially, all the domains will share a common public IP, but each will later have a public IP of its own.

Now, I have 3 options to approach this:

Option 1: Create a separate jail for each domain and install the packages in each jail. (4 jails in total)

Option 2: Create one jail for incoming messages for all domains and another jail for outgoing messages for all domains. (2 jails in total) 

Option 3: Don't create any jail and just use virtual domains hosting feature of Postfix.

Option 3 is what I use currently on another server. I am curious though if Options 1 or 2 will be better than 3. 

Based on your experience, what would you recommend as the best approach?

Thanks in advance.

Warm regards,

Nitin


----------



## gkontos (Nov 26, 2016)

Just one installation using mail/dovecot2 virtual plugin. You can configure both mail/postfix and mail/dovecot2 to listen to a certain IP address for each domain. You can also assign different SSL certificates as well. I would personally use mysql as backend and would avoid amavisd.


----------



## nitin (Nov 26, 2016)

gkontos, you are basically suggesting Option 3 sans amavisd. So what do you use instead of amavisd?


----------



## gkontos (Nov 26, 2016)

nitin said:


> gkontos, you are basically suggesting Option 3 sans amavisd. So what do you use instead of amavisd?


Although I believe that the job of the antivirus should be done on a separate, dedicated hardware, when I am asked to install Clamav, I use  security/clamav-milter.


----------



## nitin (Nov 28, 2016)

Thank you gkontos, I will leave out amavis and use individual milters instead.


----------

