Dangerous content detection with "file" command

Julian Field MailScanner at ecs.soton.ac.uk
Thu Apr 22 17:12:12 IST 2010

On 21/04/2010 15:51, Bruce R. Littlefield wrote:
>> The diffs for SweepOther.pm are as follows:
>> 410c410
>> <         $FileTypes{$1}{$2} = $3 if /^([^\/]+)\/([^:]+):\s*(.*)$/;
>> ---
>>>         $FileTypes{$1}{$2} = $3 if /^([^\/]+)\/([^:]+):\s*([^,]*),/;
> Did this ever get addressed? I checked the latest Beta and 
> SweepOther.pm still has the earlier code. I ran into the same problem 
> on a Fedora 11 server running MailScanner 4.79.11-1 RPM with sendmail, 
> spamassassin, and clamd. I found this change to be quite beneficial. 
> Is it in the queue?
That patch won't work if there is *not* a comma in the output of the 
"file" command.
What I would recommend you try instead is this:
$FileTypes{$1}{$2} = $3 if /^([^\/]+)\/([^:]+):\s*([^,]*)/;

Please try that and get back to me to let me know if it works.
For now, please email me at mailscanner at ecs.soton.ac.uk rather than post 
to the list.
If my suggested fix works, I'll release a new beta containing it.


Julian Field MEng CITP CEng
Buy the MailScanner book at www.MailScanner.info/store

Need help customising MailScanner?
Contact me!
Need help fixing or optimising your systems?
Contact me!
Need help getting you started solving new requirements from your boss?
Contact me!

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
Follow me at twitter.com/JulesFM and twitter.com/MailScanner

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

More information about the MailScanner mailing list