09 Oktober 2002

Qmail+Amavis di FreeBSD

# cd /usr/ports/security/amavis-perl/
# Edit the Makefile
.if defined(WITH_QMAIL)
MTA?=            qmail
DIROWNER?=       qmailq:qmail
CONFIGURE_ARGS+= --enable-qmail --enable-all # add --enable-all
# make WITH_QMAIL=yes install clean
# chown qmailq.qmail /usr/local/sbin/amavis
# cd /var/qmail/bin
# vim qmail-queue
Edit the first line to #!/usr/bin/suidperl -T
Be sure that the rights on suidperl are
-rwsr-xr-x  1 root  wheel  50976 Jan 28 18:53 /usr/bin/suidperl
Now edit /var/qmail/bin/qmail-queue
to your virusscanner needs Note: find the correct line's to edit...
# Open Antivirus
# Yes you want to use Openantivirus check http://www.openantivirus.org
# Openantivirus find's the Klez.x virus correct
my $oav = "yes";
# if you want to use macfee
# NAI AntiVirus (uvscan)
my $uvscan = "/usr/local/bin/uvscan";
my $uvscan_args = "--secure -rv --summary --noboot";
my $uvscan_exitcode = "13";

# If you want to use Sophos
# Sophos Anti Virus (sweep)
my $sophos = "/usr/local/bin/sweep";
my $sophos_ide = "";
# find this section
sub virus_scan {
#
# Okay, now we scan for viruses
#
# If we find one, send mail right away and quit.  No point scanning any
# more once we've found one.
#
# and add openantivirus
use IO::Socket;
   if ($oav) {
   sock = IO::Socket::INET->new('127.0.0.1:8127');

   if (defined $sock) {
          $sock->print("SCAN $TEMPDIR/parts\n");
          $sock->flush;
          chomp($output = $sock->getline);
          $sock->close;
       }
   if ($output =~ /^FOUND: /) {
          @virusname = ($output =~ /FOUND: (.+)/g);
          do_virus($output);
       }
    } 

    else {
       do_log(0,"Virus scanner failure: can't connect to daemon");
    }
}

Tidak ada komentar: