Running multiple Postfix setups

Today a customer wanted to use their current mail server for sending regular emails to a list with about 200.000 addresses in it. Sure no problem, but this will fill your queue and all other mail from/to your company will get delayed. To avoid this, you can setup Postfix so that it can run a 2nd instance of it’s binaries that has it’s own queue!

Now how do we do that? I’m assuming you already have a working Postfix installation that can send and receive email.

First we enable multi setup for postfix:

postmulti -e init

This will add the following lines to /etc/postfix/main.cf:

multi_instance_wrapper = ${command_directory}/postmulti -p —
multi_instance_enable = yes

Then we create a 2nd set of config files and a new spool dir:

postmulti -i postfix-mlist -G postfix -e create

A new config dir has been created /etc/postfix-mlist as well as a new queue dir /var/spool/postfix-mlist.
This will be added to the /etc/postfix/main.cf:

multi_instance_directories = /etc/postfix-mlist

If you run Postfix ch-rooted, do this:

cp -sr /var/spool/postfix/etc /var/spool/postfix-mlist/etc
cp -rp /var/spool/postfix/dev /var/spool/postfix-mlist/dev
cp -rp /var/spool/postfix/lib /var/spool/postfix-mlist/lib
cp -rp /var/spool/postfix/var /var/spool/postfix-mlist/var
cp -rp /var/spool/postfix/usr /var/spool/postfix-mlist/usr

Add the following lines to /etc/postfix-mlist/main.cf:

local_header_rewrite_clients = permit_mynetworks, permit_inet_interfaces
syslog_name = postfix-mlist

Now restart postfix and you’re done for the day!

/etc/init.d/postfix restart

One thought on “Running multiple Postfix setups

Leave a Reply

Your email address will not be published.

*