Matus UHLAR - fantomas wrote:
You need to check the files contents to catch that, and the ImageInfo
plugin isn't meant to understand just any kind of content.
Well, first issue was only to compare file extension to provided mime type,
so it would hit .gif file of type image/jpeg
Ah. yes. That could be done in a much more lightweight way than what my
MimeMagic plugin does.
It should be pretty easy to make a plugin doing that.
compares the content-type with the content
(using File::MimeInfo::Magic (wich uses the freedesktop file database).
that's more complicated but apparently good to have. I wonder if the real
filetype will match the extension or the mime type (or neither one)
I made it to check for windows executables sent with MIME type and
extension of an MS Office dokument.
(I did this after discovering that a couple of machines here gladly ran
an Win32 executable if it had a .doc or .xls extension when the user
double-clicked it.)
For the current image spam it's overkill, but it did hit when I ran
checked OPs example message here.
Regards
/Jonas
--
Jonas Eckerman
Fruktträdet & Förbundet Sveriges Dövblinda
http://www.fsdb.org/
http://www.frukt.org/
http://whatever.frukt.org/