scanning for filetype?
nwp at LEMON-COMPUTING.COM
Fri May 31 01:15:37 IST 2002
On Thu, May 30, 2002 at 02:32:04PM -0700, Francois Caen wrote:
> -----Original Message-----
> From: wolfgang.lumpp at GMX.NET
> > is it possible to check the attachments for filetypes?
> > How can I add such a function (I'm not a perl magician)?
> > This means, someones send a avi, which is (should) forbidden, but renames
> > the file to .txt
> Doing that would require a huge amount of AI/heuristics and processing.
> Yes, you could look at a file, see if you see a bitmap header or an ID3 tag or some thing like that, but there are so many different file formats each with its own specifics that I don't think it's feasible, especially if we're talking hundreds or thousands per hour.
The 'file' command does a pretty good job. File::MMagic is a perl module
to do the same thing... it could be done, but would slow things down.
I don't know whether there's a convenient list of the possible outputs,
And it would of course be yet another little bit of time per attachment.
Nick Phillips -- nwp at lemon-computing.com
This will be a memorable month -- no matter how hard you try to forget it.
More information about the MailScanner