[Mimedefang] Filter help - convert tiff to pdf

Kevin A. McGrail kmcgrail at pccc.com
Wed May 5 16:48:21 EDT 2004


> Any plans on adding perlmagick functions so I don't have to shell out?

PerlMagick *can* be used in the mimedefang filter without shelling out since
it to the best of my knowledge it is a front end for libmagick and an API
written to preclude shelling out.  In fact, you can pretty much use any perl
module in MIMEDefang since it uses a perl based configuration file, i.e. the
subfilter.

Anyway, I'm not trying to give a quote for custom programming as much as
saying that it doesn't sound like you are a programmer. You might be pleased
that someone has solved this before or you might be able to man
mimedefang-filter and MIME::Entity but I doubt it.  I don't think this is an
easy task.  I think I could easily kill a few days futzing around with this.

But what I would do to start look at all the MIME parts for the mail entity
already defined in filter_end().  I believe you can recursively loop through
the parts (see the mimedump example in the /examples dir of the MIME-tools
subdir).  While looping, check each part to see if it contains a tiff file.
If it does, dump it to a file and use the perl ImageMagick commands I sent
earlier to convert the file to PDF.  Then either modify the original message
or add the PDF you created as an attachment on the email. I would recommend
the latter but it might confuse your users further.

James W. Curtis posted some code a while back to replace an email with the
reportsafe function that SpamAssassin had.  I cleaned up this code a little
bit and it's in my filter
(http://www.peregrinehw.com/downloads/MIMEDefang/mimedefang-filter-KAM).
Search for REPORTSAFE and that might be a helpful starting point.

KAM



More information about the MIMEDefang mailing list