 |
Installing qmail-scanner
- Get qmail-scanner from http://unc.dl.sourceforge.net/sourceforge/qmail-scanner/qmail-scanner-1.20.tgz
- Install Maildrop 1.3.4 from the ports collection.
- su -
- cd /usr/ports/mail/maildrop
- make install
- Install Berkeley DB 3.x from the ports collection.
- cd /usr/ports/databases/db3
- make install
- Install Perl 5 from the ports collection.
- cd /usr/ports/lang/perl5
- make install
- Install tnef-1.1 from the ports collection.
- cd /usr/ports/converters/tnef
- make install
- Install unzip from the ports collection.
- cd /usr/ports/archivers/unzip
- make install
- Recompile qmail with QMAILQUEUE patch
- cd /usr/ports/mail/qmail
- make install WITH_QMAILQUEUE_PATCH=yes
- exit
- Download Perl module Time::HiRes from http://www.cpan.org/authors/id/J/JH/JHI/Time-HiRes-1.55.tar.gz
- Install the Perl Module. See instructions here.
- tar xzvf Time-HiRes-1.55.tar.gz
- cd Time-HiRes-1.55
- perl Makefile.PL
- make
- make test
- su -
- cd <source_dir>/Time-HiRes-1.55
- make install
- exit
- Download Perl module DB_File from http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-1.808.tar.gz
- Install the Perl Module. See instructions here.
- tar xzvf DB_File-1.808.tar.gz
- cd DB_File-1.808
- perl Makefile.PL
- make
- make test
- su -
- cd <source_dir>/DB_File-1.808
- make install
- exit
- Install qmail-scanner
- su -
- create user qscand
adduser
- chown root /usr/bin/suidperl
- chmod 4711 /usr/bin/suidperl
- cd <source_dir>
- tar xvzf qmail-scanner-1.01.tgz
- cd qmail-scanner-1.01
- ./configure --admin gwong --domain orchardlabs.com --notify none
- verify that this ran correctly
- ./configure --admin gwong --domain orchardlabs.com --notify none --install
- Test by running:
/var/qmail/bin/qmail-scanner-queue.pl -g
There should be no errors
- exit
- Test by running:
./contrib/test_installation.sh
This will send three emails when you run it with the -doit option
- su -
- modify /usr/local/etc/rc.d/qmail.sh and add the next two lines to the beginning of the file (after #!/bin/sh)
echo -n "qmail-smtpd, "
QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl" export QMAILQUEUE
exec /usr/local/bin/softlimit -m 5000000 /usr/local/bin/tcpserver \
-x/usr/local/etc/tcp.smtp.cdb \
-u82 -g81 0 smtp /var/qmail/bin/qmail-smtpd &
- If you are using tcpserver, you will need to add an entry for QMAILQUEUE in the tcp.smtp file and recompile the cdb (please see Installing qmail for more information)
192.168.0.:allow,QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"
- Make sure you reset your softlimit for qmail if you use softlimit
- If you want to scan outgoing files add the following lines
- In /etc/csh.cshrc add:
setenv QMAILQUEUE /var/qmail/bin/qmail-scanner-queue.pl
- In /etc/profile add:
QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"; export QMAILQUEUE
- Also it is a good idea to roll your logfiles (
/var/spool/qmailscan/qmail-queue.log with a cron job (mv -f qmail-queue.log qmail-queue.log.1)
- Also run
/var/qmail/bin/qmail-scanner-queue.pl -z once daily to delete files from dropped connections
- edit
/var/spool/qmailscan/quarantine-attachments.txt to add rules (make sure entries are TAB-delimited!)
.scr 0 W32.Badtrans.B@mm
.pif 0 W32.Badtrans.B@mm
.bat 0 W32.Sircam.Worm@mm
.com 0 W32.Sircam.Worm@mm
.lnk 0 W32.Sircam.Worm@mm
- run
/var/qmail/bin/qmail-scanner-queue.pl -g to rebuild the database
- exit
- read http://qmail-scanner.sourceforge.net/ for more info.
|