MT6 qmail

From The Network People, Inc. - Wiki
Jump to navigation Jump to search

Enter the jail

The jailmanage script mounts the /usr/ports from the host system and enters the jail:

jailmanage vpopmail

Install MTA apps

pkg install qmail perl5.18 daemontools

configure qmail

/var/qmail/scripts/enable-qmail
echo 'mail.example.com' > /var/qmail/control/me
cp /var/qmail/boot/maildir /var/qmail/rc

Install Vpopmail

cd /usr/ports/mail/vpopmail && make install clean

Enable options maildrop and ...

Install Dovecot

Dovecot provides POP3 and SMTP services.

cd /usr/ports/mail/dovecot2 && make install clean

Enable options vpopmail and libwrap.

Configure Dovecot

cd /usr/local/etc/dovecot
cp -r /usr/local/share/doc/dovecot/example-config/* .
sed -i -e 's/^#listen = \*, ::/listen = \*/' dovecot.conf
sed -i -e 's/certs\/dovecot.pem/certs\/server.crt/' conf.d/10-ssl.conf
sed -i -e 's/private\/dovecot.pem/private\/server.key/' conf.d/10-ssl.conf

Start Dovecot

echo 'dovecot_enable=YES' >> /etc/rc.conf
service dovecot start

start up qmail

echo 'svscan_enable="YES"' >> /etc/rc.conf
mkdir -p /var/service /var/qmail/supervise/smtpd
service svscan start
tee /var/qmail/supervise/smtpd/run <<EO_RUN
#!/bin/sh
PATH=/var/qmail/bin:/usr/local/vpopmail/bin
export PATH

if [ ! -f /var/qmail/control/rcpthosts ]; then
	echo "No /var/qmail/control/rcpthosts!"
	echo "Refusing to start SMTP listener because it'll create an open relay"
	exit 1
fi
exec	/usr/local/bin/softlimit -m 51200000 \
	/usr/local/bin/tcpserver -H -R -c10 \
	-u 89 -g 82 127.0.0.8 25 \
	qmail-smtpd /usr/local/vpopmail/bin/vchkpw /usr/bin/true \
	splogger qmail 
EO_RUN