On Wed, 2010-03-24 at 01:14 +0100, Jonas Eckerman wrote: > Not exactly that, but I have written a non-image-specific SA plugin that > can check for mismatches. It's a bit overkill if you only want to check > for mismatches for images though. > > It uses the freedesktop file magic database to recognize file content, > and provides eval rules to check for file types and mismatches between > content, mime type and file extension. If the freedesktop database > contains info for SVG and BMP (it should) it can check for those mismatches. > > It's named MimeMagic and is available at > <http://whatever.frukt.org/spamassassin.text.shtml> > Thanks, Jonas. That looks very useful. I've replaced my old IMAGE_MISMATCH rule with an equivalent based on MimeMagic that uses:
header IMAGE_MISMATCH eval:mimemagic_mismatch_contenttype('jpg', 'gif', 'png', 'bmp', 'svg') instead of the previous set of subrules and a meta. I don't think MimeMagic is overkill. It is probably only a matter of time before non-image files turn up with equivalent lying content types and/or extensions and adding rules to catch them will be trivial. Martin