- Update to 4.27.7

PR:		ports/63632
Submitted by:	maintainer
This commit is contained in:
Sergei Kolobov 2004-03-03 07:07:48 +00:00
parent a81ac55a59
commit d03e12ed9d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=102785
8 changed files with 52 additions and 364 deletions

View file

@ -6,8 +6,7 @@
#
PORTNAME= MailScanner
PORTVERSION= 4.26.8
PORTREVISION= 1
PORTVERSION= 4.27.7
CATEGORIES= mail
MASTER_SITES= http://www.sng.ecs.soton.ac.uk/mailscanner/files/4/tar/
DISTNAME= MailScanner-${PORTVERSION}-${PATCHLEVEL}
@ -138,7 +137,7 @@ do-install:
#
@${MKDIR} ${DATADIR}
cd ${WRKSRC}/etc && ${FIND} reports -type d -exec \
mkdir ${DATADIR}/{} \;
${MKDIR} ${DATADIR}/{} \;
cd ${WRKSRC}/etc && ${FIND} reports -type f ! -name "*.orig" -exec \
${INSTALL_DATA} {} ${DATADIR}/{}.sample \;
${CHMOD} -R ${BINMODE} ${DATADIR}/reports
@ -164,7 +163,7 @@ do-install:
${INSTALL_DATA} ${FILESDIR}/README.FreeBSD.port ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${DOC_FILES} ${DOCSDIR}
cd ${WRKSRC}/docs && \
${FIND} * -type d -exec mkdir ${DOCSDIR}/{} \; && \
${FIND} * -type d -exec ${MKDIR} ${DOCSDIR}/{} \; && \
${FIND} * -type f ! -name "*.orig" -exec \
${INSTALL_DATA} {} ${DOCSDIR}/{} \;
.endif

View file

@ -1,2 +1,2 @@
MD5 (MailScanner-4.26.8-1.tar.gz) = fc911cb81981bc0e965f0b3628e2fcb3
SIZE (MailScanner-4.26.8-1.tar.gz) = 938613
MD5 (MailScanner-4.27.7-1.tar.gz) = 587c0ac52b9ef2ba889c40d6fafdd05a
SIZE (MailScanner-4.27.7-1.tar.gz) = 965165

View file

@ -1,13 +1,8 @@
--- ../MailScanner-4.26.8.orig/docs/man/MailScanner.8 Fri Feb 13 09:31:30 2004
+++ docs/man/MailScanner.8 Fri Feb 13 09:41:31 2004
--- ../MailScanner-4.27.7.orig/docs/man/MailScanner.8 Mon Mar 1 15:25:07 2004
+++ docs/man/MailScanner.8 Mon Mar 1 15:27:56 2004
@@ -1,4 +1,4 @@
-.TH "MailScanner" "8" "4.26.6" "Julian Field" "Mail"
+.TH "MailScanner" "8" "4.26.8" "Julian Field" "Mail"
-.TH "MailScanner" "8" "4.27.4" "Julian Field" "Mail"
+.TH "MailScanner" "8" "4.27.7" "Julian Field" "Mail"
.SH "NAME"
.LP
MailScanner \- Virus/Spam Scanner for Sendmail, Exim and Postfix
@@ -100,4 +100,3 @@
.SH "SEE ALSO"
.LP
MailScanner.conf(5)
-)

View file

@ -1,8 +1,8 @@
--- ../MailScanner-4.26.8.orig/docs/man/MailScanner.conf.5 Fri Feb 13 09:31:30 2004
+++ docs/man/MailScanner.conf.5 Fri Feb 13 09:41:36 2004
--- ../MailScanner-4.27.7.orig/docs/man/MailScanner.conf.5 Mon Mar 1 15:25:07 2004
+++ docs/man/MailScanner.conf.5 Mon Mar 1 15:28:04 2004
@@ -1,4 +1,4 @@
-.TH "MailScanner.conf" "5" "4.26.6" "Julian Field" "Mail"
+.TH "MailScanner.conf" "5" "4.26.8" "Julian Field" "Mail"
-.TH "MailScanner.conf" "5" "4.27.4" "Julian Field" "Mail"
+.TH "MailScanner.conf" "5" "4.27.7" "Julian Field" "Mail"
.SH "NAME"
.LP
MailScanner.conf \- Main configuration for MailScanner

View file

@ -1,74 +0,0 @@
--- ../MailScanner-4.26.8.orig/lib/MailScanner/Exim.pm Fri Feb 13 10:16:22 2004
+++ lib/MailScanner/Exim.pm Fri Feb 13 10:17:04 2004
@@ -250,7 +250,7 @@
my($RQf) = $message->{store}{inhhandle};
my %metadata;
- my($InHeader, $InSubject, $InDel, @headers, $msginfo, $from, @to, $subject);
+ my($InHeader, $InSubject, $InDel, @headers, $msginfo, $from, @to, $subject, @acl);
my($ip, $sender);
my($line);
@@ -282,12 +282,34 @@
# and tracking them in %{$metadata{dashvars}}
while (chomp($line = <$RQf>)) {
$line =~ s/^-(\w+) ?// or last;
- $metadata{dashvars}{$1} = 0;
- $line eq "" and $metadata{"dv_$1"} = 1, next;
- $metadata{"dv_$1"} = $line;
- $metadata{dashvars}{$1} = 1;
+ if($1 eq "acl") {
+ # we need to handle acl vars differently
+ if($line =~ /^(\d+) (\d+)$/) {
+ my $buf;
+ my $pos=$1;
+ my $len=$2;
+ $acl[$pos]=[];
+ (read($RQf, $buf, $len + 1)==$len+1) or last;
+ if($buf=~/\n$/) {
+ chomp $buf;
+ } else {
+ # invalid format
+ last;
+ }
+ $acl[$pos]->[0]=$buf;
+ } else {
+ # this is a weird format, and we're not sure how to handle it
+ last;
+ }
+ } else {
+ $metadata{dashvars}{$1} = 0;
+ $line eq "" and $metadata{"dv_$1"} = 1, next;
+ $metadata{"dv_$1"} = $line;
+ $metadata{dashvars}{$1} = 1;
+ }
next;
}
+ $metadata{aclvars}=\@acl;
# If it was an invalid queue file, log a warning and tell caller
unless (defined $line) {
@@ -965,6 +987,7 @@
sub CreateQf {
my($message) = @_;
+ my $i;
my $Qfile = "";
my $metadata = $message->{metadata};
@@ -992,6 +1015,15 @@
$Qfile .= "\n";
}
+ # Add the separate ACL Vars
+ my @acl=@{$metadata->{aclvars}};
+ for($i=0; $i<=$#acl; $i++) {
+ if($acl[$i]) {
+ $Qfile .= "-acl " . $i . " " . length($acl[$i]->[0]) . "\n";
+ $Qfile .= $acl[$i]->[0] . "\n";
+ }
+ }
+
# Add non-recipients
$Qfile .= BTreeString($metadata->{nonrcpts});

View file

@ -1,240 +0,0 @@
--- ../MailScanner-4.26.8.orig/lib/MailScanner/Message.pm Mon Feb 23 17:37:26 2004
+++ lib/MailScanner/Message.pm Mon Feb 23 17:38:33 2004
@@ -2,7 +2,7 @@
# MailScanner - SMTP E-Mail Virus Scanner
# Copyright (C) 2002 Julian Field
#
-# $Id: Message.pm,v 1.126.2.74 2004/01/27 15:20:58 jkf Exp $
+# $Id: Message.pm,v 1.126.2.76 2004/02/11 12:10:08 jkf Exp $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@
use vars qw($VERSION);
### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = substr q$Revision: 1.126.2.74 $, 10;
+$VERSION = substr q$Revision: 1.126.2.76 $, 10;
# Attributes are
#
@@ -548,8 +548,13 @@
if ($HamSpam eq 'nonspam') {
MailScanner::Log::WarnLog("Does not make sense to bounce non-spam");
} else {
- MailScanner::Log::WarnLog('The "bounce" Spam Action no longer exists');
- # Do not uncomment this $this->HandleSpamBounce();
+ #MailScanner::Log::WarnLog('The "bounce" Spam Action no longer exists');
+ if ($this->{ishigh}) {
+ MailScanner::Log::InfoLog("Will not bounce high-scoring spam")
+ } else {
+ $this->HandleSpamBounce()
+ if MailScanner::Config::Value('enablespambounce', $this);
+ }
}
}
@@ -684,7 +689,7 @@
$messagefh->open($filename)
or MailScanner::Log::WarnLog("Cannot open message file %s, %s",
$filename, $!);
- $emailmsg = "";
+ $emailmsg = "X-MailScanner-Bounce: yes\n";
while(<$messagefh>) {
chomp;
s#"#\\"#g;
@@ -1007,11 +1012,80 @@
}
}
+ $this->ExplodePart($explodeinto);
+
# Set the owner and group on all the extracted files
chown $workarea->{uid}, $workarea->{gid}, glob "$explodeinto/*"
if $workarea->{changeowner};
}
+# Try to parse all the text bits of each message, looking to see if they
+# can be parsed into files which might be infected.
+# How I treat these in the MIME structure is anyone's guess!
+sub ExplodePart {
+ my($this, $explodeinto) = @_;
+
+ my($dir, $part);
+
+ $dir = new DirHandle;
+
+ $dir->open($explodeinto);
+ while($part = $dir->read) {
+ #print STDERR "Reading $part\n";
+ next unless $part =~ /^msg.*txt/;
+
+ # Try and find hidden messages in the text files
+ my $file = new FileHandle;
+ #print STDERR "About to read $explodeinto/$part\n";
+ $file->open("$explodeinto/$part") or next;
+
+ # Try reading the first few lines to see if they look like mail headers
+ my($linenum, $foundheader, $prevline, $line, $position, $prevpos);
+ $foundheader = 0;
+ $prevpos = 0;
+ for ($linenum=0; $linenum<100 && !$file->eof(); $linenum++) {
+ $position = $file->getpos();
+ $line = <$file>;
+ # Must have 2 lines of header
+ if ($prevline =~ /^[^:]+: / && $line =~ /(^\s+)|(^[^:]+ )|(^\s+.*=)/) {
+ #print STDERR "Found start of a header at \"$prevline\"\n and \"$line\"\n";
+ $foundheader = 1;
+ last;
+ }
+ $prevline = $line;
+ $prevpos = $position;
+ }
+
+ unless ($foundheader) {
+ $file->close();
+ $dir->close();
+ return;
+ }
+
+ # Rewind to the start of the header
+ $file->setpos($prevpos);
+
+ # Setup everything for the MIME parser
+ my $parser = MIME::Parser->new;
+ my $filer = MIME::Parser::FileInto::MailScanner->new($explodeinto);
+
+ # Over-ride the default default character set handler so it does it
+ # much better than the MIME-tools default handling.
+ MIME::WordDecoder->default->handler('*' => \&WordDecoderKeep7Bit);
+
+ #print STDERR "Exploding message " . $this->{id} . " into " .
+ # $explodeinto . "\n";
+ $parser->filer($filer);
+ $parser->extract_uuencode(1); # uue is off by default
+ $parser->output_to_core('NONE'); # everything into files
+
+ # Do the actual parsing
+ my $entity = eval { $parser->parse($file) };
+
+ $file->close;
+ }
+}
+
# Print the infection reports for this message
sub PrintInfections {
@@ -1167,10 +1241,13 @@
# them some time later, but I wanted to keep them separate if possible
# in case anyone wanted a feature in the future which would be easier
# with separate reports.
+# If safefile2file does not map for a filename, ban the whole message
+# to be on the safe side.
sub CombineReports {
my $this = shift;
my($file, $text, $Name);
+ my(%reports, %types);
#print STDERR "Combining reports for " . $this->{id} . "\n";
# If they want to include the scanner name in the reports, then also
@@ -1191,29 +1268,48 @@
while (($file, $text) = each %{$this->{virusreports}}) {
#print STDERR "Adding file $file report $text\n";
$this->{allreports}{$file} .= $text;
+ $reports{$file} .= $text;
}
while (($file, $text) = each %{$this->{virustypes}}) {
#print STDERR "Adding file $file type $text\n";
$this->{alltypes}{$file} .= $text;
+ $types{$file} .= $text;
}
while (($file, $text) = each %{$this->{namereports}}) {
#print STDERR "Adding file \"$file\" report \"$text\"\n";
$text =~ s/\n(.)/\n$Name: $1/g; # Make sure name is at the front of this
#print STDERR "report is now \"$text\"\n";
$this->{allreports}{$file} .= $Name . $text;
+ $reports{$file} .= $Name . $text;
}
while (($file, $text) = each %{$this->{nametypes}}) {
#print STDERR "Adding file $file type $text\n";
$this->{alltypes}{$file} .= $text;
+ $types{$file} .= $text;
}
while (($file, $text) = each %{$this->{otherreports}}) {
#print STDERR "Adding file $file report $text\n";
$this->{allreports}{$file} .= $Name . $text;
+ $reports{$file} .= $Name . $text;
}
while (($file, $text) = each %{$this->{othertypes}}) {
#print STDERR "Adding file $file type $text\n";
$this->{alltypes}{$file} .= $text;
+ $types{$file} .= $text;
+ }
+
+ # Now look for the reports we can't match anywhere and make them
+ # map to the entire message.
+ my($key, $value);
+ while(($key, $value) = each %reports) {
+ if (!exists($this->{safefile2file}{$key})) {
+ delete $this->{allreports}{$key};
+ delete $this->{alltypes}{$key};
+ $this->{allreports}{""} .= $value;
+ $this->{alltypes}{""} .= $types{$key};
+ }
}
+
#print STDERR "Finished combining reports\n";
}
@@ -3309,6 +3405,50 @@
$index = $#{$self->{ME_Parts}} + 2 + $index if ($index < 0);
splice(@{$self->{ME_Parts}}, $index, 0, $part);
$part;
+}
+
+
+#
+# Over-ride a function in Mail::Header that parses the block of headers
+# at the top of each MIME section. My improvement allows the first line
+# of the header block to be missing, which breaks the original parser
+# though the filename is still there.
+#
+
+package Mail::Header;
+
+sub extract
+{
+ my $me = shift;
+ my $arr = shift;
+ my $line;
+
+ $me->empty;
+
+ # JKF Make this more robust by allowing first line of header to be missing
+ shift @{$arr} while scalar(@{$arr}) &&
+ $arr->[0] =~ /\A[ \t]+/o &&
+ $arr->[1] =~ /\A$FIELD_NAME/o;
+ # JKF End mod here
+
+ while(scalar(@{$arr}) && $arr->[0] =~ /\A($FIELD_NAME|From )/o)
+ {
+ my $tag = $1;
+
+ $line = shift @{$arr};
+ $line .= shift @{$arr}
+ while(scalar(@{$arr}) && $arr->[0] =~ /\A[ \t]+/o);
+
+ ($tag,$line) = _fmt_line($me,$tag,$line);
+
+ _insert($me,$tag,$line,-1)
+ if defined $line;
+ }
+
+ shift @{$arr}
+ if(scalar(@{$arr}) && $arr->[0] =~ /\A\s*\Z/o);
+
+ $me;
}

View file

@ -1,11 +1,12 @@
--- ../MailScanner-4.26.8.orig/lib/clamav-wrapper Fri Feb 13 09:31:30 2004
+++ lib/clamav-wrapper Fri Feb 13 09:40:30 2004
@@ -35,6 +35,8 @@
#
#
+PATH=$PATH:/usr/local/bin
+export PATH
--- ../MailScanner-4.27.7.orig/lib/clamav-wrapper Mon Mar 1 15:28:58 2004
+++ lib/clamav-wrapper Mon Mar 1 15:30:00 2004
@@ -51,6 +51,9 @@
# You may want to check this script for bash-isms
+PATH=$PATH:/usr/local/bin
+export PATH
+
TempDir="/tmp/clamav.$$"
ClamUser="clamav"
ClamGroup="clamav"

View file

@ -25,6 +25,8 @@ lib/MailScanner/MailScanner/Message.pm
lib/MailScanner/MailScanner/MessageBatch.pm
lib/MailScanner/MailScanner/PFDiskStore.pm
lib/MailScanner/MailScanner/Postfix.pm
lib/MailScanner/MailScanner/QMDiskStore.pm
lib/MailScanner/MailScanner/Qmail.pm
lib/MailScanner/MailScanner/Quarantine.pm
lib/MailScanner/MailScanner/Queue.pm
lib/MailScanner/MailScanner/RBLs.pm
@ -48,6 +50,8 @@ libexec/MailScanner/bitdefender-wrapper.sample
libexec/MailScanner/clamav-autoupdate.sample
libexec/MailScanner/clamav-wrapper.sample
libexec/MailScanner/command-wrapper.sample
libexec/MailScanner/css-wrapper.sample
libexec/MailScanner/css-autoupdate.sample
libexec/MailScanner/drweb-wrapper.sample
libexec/MailScanner/etrust-autoupdate.sample
libexec/MailScanner/etrust-wrapper.sample
@ -75,29 +79,29 @@ libexec/MailScanner/sophos-wrapper.sample
libexec/MailScanner/trend-autoupdate.sample
libexec/MailScanner/trend-wrapper.sample
libexec/MailScanner/update_virus_scanners
%%DATADIR%%/reports/cat/deleted.filename.message.txt.sample
%%DATADIR%%/reports/cat/deleted.virus.message.txt.sample
%%DATADIR%%/reports/cat/disinfected.report.txt.sample
%%DATADIR%%/reports/cat/inline.sig.html.sample
%%DATADIR%%/reports/cat/inline.sig.txt.sample
%%DATADIR%%/reports/cat/inline.spam.warning.txt.sample
%%DATADIR%%/reports/cat/inline.warning.html.sample
%%DATADIR%%/reports/cat/inline.warning.txt.sample
%%DATADIR%%/reports/cat/languages.conf.sample
%%DATADIR%%/reports/cat/recipient.mcp.report.txt.sample
%%DATADIR%%/reports/cat/recipient.spam.report.txt.sample
%%DATADIR%%/reports/cat/sender.error.report.txt.sample
%%DATADIR%%/reports/cat/sender.filename.report.txt.sample
%%DATADIR%%/reports/cat/sender.spam.rbl.report.txt.sample
%%DATADIR%%/reports/cat/sender.spam.report.txt.sample
%%DATADIR%%/reports/cat/sender.spam.sa.report.txt.sample
%%DATADIR%%/reports/cat/sender.virus.report.txt.sample
%%DATADIR%%/reports/cat/stored.filename.message.txt.sample
%%DATADIR%%/reports/cat/stored.virus.message.txt.sample
%%DATADIR%%/reports/cat/deleted.content.message.txt.sample
%%DATADIR%%/reports/cat/sender.content.report.txt.sample
%%DATADIR%%/reports/cat/sender.mcp.report.txt.sample
%%DATADIR%%/reports/cat/stored.content.message.txt.sample
%%DATADIR%%/reports/ca/deleted.filename.message.txt.sample
%%DATADIR%%/reports/ca/deleted.virus.message.txt.sample
%%DATADIR%%/reports/ca/disinfected.report.txt.sample
%%DATADIR%%/reports/ca/inline.sig.html.sample
%%DATADIR%%/reports/ca/inline.sig.txt.sample
%%DATADIR%%/reports/ca/inline.spam.warning.txt.sample
%%DATADIR%%/reports/ca/inline.warning.html.sample
%%DATADIR%%/reports/ca/inline.warning.txt.sample
%%DATADIR%%/reports/ca/languages.conf.sample
%%DATADIR%%/reports/ca/recipient.mcp.report.txt.sample
%%DATADIR%%/reports/ca/recipient.spam.report.txt.sample
%%DATADIR%%/reports/ca/sender.error.report.txt.sample
%%DATADIR%%/reports/ca/sender.filename.report.txt.sample
%%DATADIR%%/reports/ca/sender.spam.rbl.report.txt.sample
%%DATADIR%%/reports/ca/sender.spam.report.txt.sample
%%DATADIR%%/reports/ca/sender.spam.sa.report.txt.sample
%%DATADIR%%/reports/ca/sender.virus.report.txt.sample
%%DATADIR%%/reports/ca/stored.filename.message.txt.sample
%%DATADIR%%/reports/ca/stored.virus.message.txt.sample
%%DATADIR%%/reports/ca/deleted.content.message.txt.sample
%%DATADIR%%/reports/ca/sender.content.report.txt.sample
%%DATADIR%%/reports/ca/sender.mcp.report.txt.sample
%%DATADIR%%/reports/ca/stored.content.message.txt.sample
%%DATADIR%%/reports/cy+en/deleted.content.message.txt.sample
%%DATADIR%%/reports/cy+en/deleted.filename.message.txt.sample
%%DATADIR%%/reports/cy+en/deleted.virus.message.txt.sample
@ -504,10 +508,12 @@ libexec/MailScanner/update_virus_scanners
%%PORTDOCS%%%%DOCSDIR%%/press.html
%%PORTDOCS%%%%DOCSDIR%%/readme.shtml
%%PORTDOCS%%%%DOCSDIR%%/reject.html
%%PORTDOCS%%%%DOCSDIR%%/qmail/qmail-queue.zip
%%PORTDOCS%%%%DOCSDIR%%/sobig.html
%%PORTDOCS%%%%DOCSDIR%%/support.html
%%PORTDOCS%%%%DOCSDIR%%/transtec.logo.gif
%%PORTDOCS%%%%DOCSDIR%%/users.shtml
%%PORTDOCS%%@dirrm %%DOCSDIR%%/qmail
%%PORTDOCS%%@dirrm %%DOCSDIR%%/man
%%PORTDOCS%%@dirrm %%DOCSDIR%%/install/tcp
%%PORTDOCS%%@dirrm %%DOCSDIR%%/install/mcp
@ -529,6 +535,7 @@ libexec/MailScanner/update_virus_scanners
@dirrm %%DATADIR%%/reports/cz
@dirrm %%DATADIR%%/reports/cy+en
@dirrm %%DATADIR%%/reports/cat
@dirrm %%DATADIR%%/reports/ca
@dirrm %%DATADIR%%/reports
@dirrm %%DATADIR%%
@dirrm libexec/MailScanner