file and "file -i"
UxBoD
uxbod at splatnix.net
Mon Jan 7 12:27:28 UTC 2008
Hmmm, using a perl module would be a good idea Steve. I wonder what the performance differential would be ?
Regards,
--[ UxBoD ]--
// PGP Key: "curl -s https://www.splatnix.net/uxbod.asc | gpg --import"
// Fingerprint: C759 8F52 1D17 B3C5 5854 36BD 1FB1 B02F 5DB5 687B
// Keyserver: www.keyserver.net Key-ID: 0x5DB5687B
// Phone: +44 845 869 2749 SIP Phone: uxbod at sip.splatnix.net
----- Original Message -----
From: "Steve Freegard" <steve.freegard at fsl.com>
To: "MailScanner Beta-testers" <mailscanner-beta at lists.mailscanner.info>
Sent: 07 January 2008 12:20:21 o'clock (GMT) Europe/London
Subject: Re: file and "file -i"
Matt Hampton wrote:
> Julian Field wrote:
>
>> The output from file and file -i are *completely* different, and they
>> use a different magic file to produce it. This change would require all
>> users rewrite all their filetypes.rules.conf files completely.
>> :-(
>>
>
> Ah - but that would be a nice feature - check whether the mime type in
> the message matches the mime type of the file.....
>
Hmmm - you'd have to be pretty careful doing that as numerous FPs are
likely to occur e.g. application/x-zip .vs. application/zip depending on
what generated the message and what the magic file contains.
I personally prefer using mimetypes instead of 'file' as I've always
noticed far less FPs with 'file -i'. It's pretty easy to do this by
pointing the file command to a shell-script that runs 'file -bi $*'
instead and modify the filetypes rules accordingly.
It might be a nice feature to be able to use File::Type or File::MMagic
instead of 'file -bi' though as it will return the result from an open
filehandle instead of fork/exec of 'file'.
Cheers,
Steve.
--
MailScanner-Beta mailing list
mailscanner-beta at lists.mailscanner.info
http://lists.mailscanner.info/mailman/listinfo/mailscanner-beta
Before posting, read http://wiki.mailscanner.info/posting
Support MailScanner development - buy the book off the website!
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the MailScanner-Beta
mailing list