Bug in too many attachments?

paddy paddy at PANICI.NET
Thu Nov 25 10:19:45 GMT 2004

On Thu, Nov 25, 2004 at 10:36:06AM +0100, Francesco Rotondo wrote:
> At 10.25 25/11/2004, you wrote:
> >On Thu, Nov 25, 2004 at 10:15:04AM +0100, Francesco Rotondo wrote:
> >> Hi all,
> >> I'm running MS 4.35.11-1 and have the Maximum Attachments Per Message set
> >> to the default value of 200. Yesterday a message has been quarantined
> >> because it had Too many attachments but watching into the message I've
> >> found that attachments were only 65. Has anyone else experienced this?
> >> Regards
> >
> >Just a guess, but are some of those zips or whatever, so that the total
> >_when unpacked_ is greater than the limit.  There is/was a very similar
> >thread running.
> >
> >Regards,
> >Paddy
> Thanks for pointing out that. I watched the message again but there are no
> zip. Attachments are only doc, pdf, txt, xls and jpg.

I suppose it was a bit much to hope for: such a behaviour wouldn't go unnoticed
long.  I've looked at the code, but the task getting rapidly beyond my
original hit'n'run motivation ;)  Still ...

As far as I can see, the decision is made in Message::Explode on the

        if ($maxparts>0 && MIME::Entity::MailScannerCounter()>=$maxparts)

I haven't read MIME:Entity, but I would be looking for one of two things here:
(1) get MailScanner to leave the temporary files behind,
(2) log the value it counts
I can't immediately see how to get (1), but (2) is as simple as altering line
1123 just below from

  MailScanner::Log::WarnLog("Too many attachments in %s", $this->{id});

to something like:

  MailScanner::Log::WarnLog("Too many attachments in %s %s", $this->{id}, MIME::Entity::MailScannerCounter());

or better still: adding a log line that you can then simply rem out later.

I hope. If you can call that function twice.  I'll go and try !


Perl 6 will give you the big knob. -- Larry Wall

------------------------ 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).

Support MailScanner development - buy the book off the website!

More information about the MailScanner mailing list