procmail
[Top] [All Lists]

Re: converting tiff attachments

2005-01-10 06:45:34
On Sat, Jan 08, 2005 at 09:07:01PM +0200, Hans du Plooy wrote:

I would like to make a procmail recipe that converts any tiff
attachment (possibly from a certain domain) to a pdf so that the
recipient receives only the mail with a .pdf attachment.  How do I do
this?

I'm not sure how to do the conditions, and testing the conversion from
command line leads me to believe tiff2pdf doesn't understand sdtin.
This is what I have so far


:0
*
| reformime -X -s 1.2 | tiff2pdf -o attachment.pdf -p A4 -f -

Well, first of all a note that if you have no conditions, you do
not need an empty "*".  A recipe can have no conditions.

But I realize you want some conditions. 

  * From:(_dot_)*(_at_)somedomain\(_dot_)dom
  * Content-Type:.*(attachment|multipart)
  * B ?? ()\<filename=.*\.tif\>

is probably a start at a draft for your conditions.

As for your action, replacing one MIME part with another is something
probably best left for another program.  (Though perhaps Bart Schaefer's
published MIME manipualtion stuff in procmail would work.)  I think
you'd have to have reformime build the new message out of the other
pieces of the old.  Or, you'd at least have to rewrite some headers or
body fields to deal with the new filename, content length, and so on.
It is not trivial.

-- 
dman

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>