|
Prepared by
NOD32 Hong Kong
May 2004
Introduction
There are
varies kinds of setup methods for Qmail, e.g. using amavisd, or
dual qmail system, but it is difficult to config them.
Here we use an open source project qmail-amavisd integration,
which forward emails to nod32smtp in qmail-queue. Both incoming
and outgoing emails are scanned
You are required to compile qmail-smtp with
QMAILQUEUE patch.
Please refer to
qmail for more information
Compile the
program
Linux plaform
FreeBSD plaform
make
You can see
there is an executable qmail-queue.smtp, replace the original
qmail-queue with this, and create a new smtp service, for
receiving emails from NOD32
mv /var/qmail/bin/qmail-queue /var/qmail/bin/qmail-queue-dr
cp qmail-queue.smtp /var/qmail/bin/qmail-queue
cp -a /var/qmail/supervise/qmail-smtpd
/var/qmail/supervise/qmail-smtpd-nod32
Then change
the listen port of qmail-smtpd-nod32 to 2525, here is an example
of /var/qmail/supervise/qmail-smtpd-nod32/run. Change the path
of tcp rules database too
#!/bin/sh
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
exec /usr/local/bin/softlimit -m 2000000 \
/usr/local/bin/tcpserver -H -R -v -p -x
/etc/tcp.smtp.nod32.cdb \
-u $QMAILDUID -g $NOFILESGID 0 2525
/var/qmail/bin/qmail-smtpd 2>&1
Create a new
file /etc/tcp.smtp.nod32
127.0.0.1:allow,RELAYCLIENT="",QMAILQUEUE="/var/qmail/bin/qmail-queue-dr"
:allow
Generate the
new db
tcprules /etc/tcp.smtp.nod32.cdb /etc/tcp.smtp.nod32.tmp <
/etc/tcp.smtp.nod32
Start your
qmail-smtpd-nod32 by putting a symbolic in /services, or by your
own means
ln -s /var/qmail/supervise/qmail-smtpd-nod32 /services/
start
nod32smtp, and restart your qmail
chkconfig --level 35 nod32smtp on
service nod32smtp start
If you use
qmailctl (redhat, suse etc) in init.d, you have to add the
entries yourself |