file and "file -i"
Steve Freegard
steve.freegard at fsl.com
Mon Jan 7 12:20:21 UTC 2008
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.
More information about the MailScanner-Beta
mailing list