freebsd下增加第二个postfix进程

默认系统只运行一个Postfix(MTA),它监听在25端口,有时我们需要运行多一个postfix,假设让它监听在225端口上,本笔记虽然是在FreeBSD系统上测试通过,其中多数内容也适合各个Linux发行版本以及各个BSD分支,在其他系统上只需要做少量调整。

cp -rp /usr/local/etc/postfix /usr/local/etc/postfixsecend
vi /usr/local/etc/postfixsecend/main.cf
change:
queue_directory = /var/spool/postfix
to:
queue_directory = /var/spool/postfixsecend
:wq
mkdir /var/spool/postfixsecend
postfix -c /usr/local/etc/postfixsecend check
vi /usr/local/etc/postfix/main.cf
add:
alternate_config_directories = /usr/local/etc/postfixsecend
:wq
vi /usr/local/etc/postfixsecend/main.cf
add:
inet_interfaces = 202.181.206.235
:wq
vi /usr/local/etc/postfix/main.cf
add:
smtp_bind_address = 202.181.206.234
:wq
vi /etc/services
add:
smtp2            225/tcp    mail         #Simple Mail Transfer
smtp2            225/udp    mail         #Simple Mail Transfer
:wq
vi /usr/local/etc/postfixsecend/master.cf
change:
smtp      inet  n       -       n       -       -       smtpd
to:
smtp2      inet  n       -       n       -       -       smtpd
:wq
postfix -c /usr/local/etc/postfixsecend start