[Tutor] robo-editing a mail stream

Allyn Weaks allyn.@tardigrade.net
Sat Nov 9 20:29:01 2002


I want to write a small filter that can robo-edit the mail sent to some
of my mailing lists (removing all quoted lines at the bottom of a
post).  The filter itself is simple and I can deal with that part, but
it needs to sit in a stream between another mail filter (demime) and
the list server software (currently majordomo, but it shouldn't matter)

Currently, mail comes to the list, is sent to the demime program, which
passes the results to the major:.  The sendmail alias looks like this:

LISTNAME: "|/usr/local/majordomo/wrapper demime
|usr/local/majordomo/wrapper resend (parameter list)"

wrapper is a security wrapper that I don't completely understand,
demime is a perl program that removes attachments and html, resend is
the majordomo module that handles posted messages.

What I'd like is something that sits between demime and resend, like:

LISTNAME: "|/usr/local/majordomo/wrapper demime |myfilter myparameters
|usr/local/majordomo/wrapper resend (parameter list)"

So basically my filter needs to take a correct mail message, modify it,
and pipe it on as a correct mail message to resend.  Is there anything
I need to know about security, or other gotchas, other than just
grabbing the text from a pipe and passing the new text in a pipe?  I
may be adding a single header line as notification that the body was
changed (if it is).  Is there anything tricky about being a
middle-droid?  Better yet, does someone have an example I can steal
from?  I peeked at demime, but it's perl...

Thanks!
-- 
Allyn Weaks    allyn@tardigrade.net   Seattle, WA  Sunset zone 5
Pacific NW Native Wildlife Gardening: http://www.tardigrade.org/natives/
"The benefit of even limited monopolies is too doubtful, to be opposed
to that of their general suppression."  Thomas Jefferson