minimum attachment size?
Julian Field
mailscanner at ecs.soton.ac.uk
Thu Nov 4 15:29:43 GMT 2004
[ The following text is in the "ISO-8859-1" character set. ]
[ Your display is set for the "US-ASCII" character set. ]
[ Some characters may be displayed incorrectly. ]
Quentin Campbell wrote:
>>-----Original Message-----
>>From: MailScanner mailing list
>>[mailto:MAILSCANNER at JISCMAIL.AC.UK] On Behalf Of Julian Field
>>Sent: 04 November 2004 14:56
>>To: MAILSCANNER at JISCMAIL.AC.UK
>>Subject: Re: minimum attachment size?
>>
>>Thanks for that. I was checking all files involved in the mail,
>>including the body, where I should only have been checking the
>>attachments. Fixed in 4.35.11 which I have just released.
>>
>>
>>
>[snip]
>
>Julain
>
>Sigh! Just finished upgrading 8 machines to 4.35.10. Wanted to use that
>feature.
>
>Any chance of a patch file? If not, which Perl program changed so I can
>upgrade just one system and copy the changed file to the others?
>
>
Only SweepContent.pm changed. I have attached a patch to take that code
from 4.35.10 to 4.35.11.
--
Julian Field
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
Professional Support Services at www.MailScanner.biz
MailScanner thanks transtec Computers for their support
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
[ Part 2: "Attached Text" ]
--- ../../../MailScanner-4.35.10/lib/MailScanner/SweepContent.pm Wed Nov 3 13:21:33 2004
+++ SweepContent.pm Thu Nov 4 13:47:03 2004
@@ -294,20 +294,25 @@
# "Safe" attachment filename is in $safename, this is what we stat
$attachsize = -s "$BaseDir/$safename";
- if ($maxsize>=0 && $attachsize > $maxsize) {
+ #print STDERR "\nSafename = $safename\n";
+ #print STDERR "Attachsize=$attachsize\nMin=$minsize\nMax=$maxsize\n";
+ if ($maxsize>=0 && $attachsize > $maxsize &&
+ $safename !~ /^msg[-\d]+\.(txt|html)$/) {
$unsafename = $message->{safefile2file}{$safename} || $tnefname;
- MailScanner::Log::InfoLog("Attachment size check: %s > %s (%s)",
- $attachsize, $maxsize, $unsafename);
+ MailScanner::Log::InfoLog("Attachment size check: %s > %s (%s) in %s",
+ $attachsize, $maxsize, $unsafename, $id);
$message->{otherreports}{$safename} .=
MailScanner::Config::LanguageValue($message,'attachmenttoolarge') . "\n";
$message->{othertypes}{$safename} .= "e";
$counter++;
$message->{otherinfected}++;
}
- if ($attachsize < $minsize) {
+ if ($minsize>=0 && $attachsize < $minsize &&
+ $safename !~ /^msg[-\d]+\.(txt|html)$/) {
+ #print STDERR "Attachment is too small\n";
$unsafename = $message->{safefile2file}{$safename} || $tnefname;
- MailScanner::Log::InfoLog("Attachment size check: %s < %s (%s)",
- $attachsize, $minsize, $unsafename);
+ MailScanner::Log::InfoLog("Attachment size check: %s < %s (%s) in %s",
+ $attachsize, $minsize, $unsafename, $id);
$message->{otherreports}{$safename} .=
MailScanner::Config::LanguageValue($message,'attachmenttoosmall') . "\n";
$message->{othertypes}{$safename} .= "e";
------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
More information about the MailScanner
mailing list