Building Postfix 3.x on NetBSD 7

this is not really required now since NetBSD 8 has Postfix 3.1.4

although we are going to use Dovecot’s implementation of SASL, we could not get around this library

pkg_add cyrus-sasl
#cd /usr/pkgsrc/security/cyrus-sasl/
#make install
ll /usr/pkg/lib/sasl2/ #old
ll /usr/pkg/etc/sasl2/ #new

also we are going to enable SPF

pkg_add py-policyd-spf
#cd /usr/pkgsrc/mail/py-policyd-spf/
#make install

fetch the latest Postfix release, extract it and compile with TLS/openssl and SASL/dovecot

cd postfix-3.x.x/
#make tidy
make makefiles CCARGS="-DUSE_TLS -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\"dovecot\"" AUXLIBS="-lssl -lcrypto"

ll /usr/local/include/
ll /usr/local/lib/
ll /usr/pkg/include/sasl/
ll /usr/pkg/lib/sasl2/

make makefiles \
'CCARGS=-I/usr/local/include -I/usr/pkg/include/sasl \
-DDEF_SERVER_SASL_TYPE=\"dovecot\" \
'AUXLIBS=-L/usr/local/lib -L/usr/pkg/lib/sasl2 \
-lssl -lcrypto -lsasl2'

dmesg | egrep cpu[0-9]+:
time make -j8

grep postfix /etc/passwd
grep postfix /etc/group
grep maildrop /etc/group

/etc/rc.d/postfix stop                               
echo 'postfix=no' >> /etc/rc.conf

make install
#ENTER ENTER... overriding the system defaults

check that make install indeed overwrote the default Postfix

which postfix
which postconf
postconf -d|grep ^mail_ver

check that you got cyrus and dovecot enabled

postconf -a

Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml