On 14 Jun 2004, [EMAIL PROTECTED] wrote: Ted Zlatanov wrote: >> set QMAILQUEUE to this script: >> #!/bin/sh >> exec /var/qmail/bin/qmail-qfilter \ >> cat - /etc/mailtag >> (there's more in the recipe, but this should be enough to get >> started) > > What about messages with attachments? emails with both HTML and plain > text? and signed/encrypted emails?
Note I did not write the recipe, it came from John Levine's excellent book on qmail. If you wish to handle all the possible types of e-mails above, that's fine, you just have to write software that interprets and possibly ignores the ones it can't handle. E-mail with "both HTML and plain text" and "with attachments" are just various instances of MIME multipart messages. I believe encrypted e-mails also work their magic with multipart messages, although I don't use such encryption so I don't know for sure. So the parser doesn't have to be incredibly sophisticated. I'm sure you can write something using Perl and CPAN modules in a day or two (or using whatever scripting language you like). Still, automatically modifying all e-mail is a tricky business. Doing it in order to add a footer is sure to annoy people. I would insert a header, X-Notice-of-corporate-tomfoolery or whatever you call it, which is MUCH easier to do reliably than to modify the *contents* of the message. It would work with all the examples you gave. Ted
