procmail
[Top] [All Lists]

RE: Alter Body Based on Looked-up Data

2007-05-31 06:00:13


Is there some reason you have to send back the exact same
format you got?  As I mentioned previously, a tool such as
demime will work fine.

I have set up an auto-responder that I will leave up for
a couple of days, anyway.  Write "dman+procmail(_at_)nomotek(_dot_)com"
with any message style you want and you will get it back
demimed and quoted, with a message prepended.

Here is my code:

######################## start ########################

 TESTADDR = dman+procmail(_at_)nomotek(_dot_)com

 :0
 * $  ^To:(.*\<)$\TESTADDR
 * $ !^X-Loop:(.*\<)?$\TESTADDR
 {
    TESTMSG = "This is a canned message prepended to the body,${NL}"
    TESTMSG = "${TESTMSG}which has been demimed and will be
delivered${NL}"
    TESTMSG = "${NL}${NL}${TESTMSG}back to ${RET_ADDR}."

    :0 fw
    | demime --uselynx

    :0
    | formail -rkp "> " -I "X-Loop: ${TESTADDR}${TESTMSG}" \
    | "$SENDMAIL" $SENDMAILFLAGS -t
 }

######################### end #########################

Note that a couple of things were predefined, such as NL
and RET_ADDR.  (I had that available already from my
regular .procmailrc, which the message has run through
by the time it gets here.)

Or if you must have the original format, then do what
LuKreme has just suggested in a follow-up message that
arrived while I was preparing this:

L> Take the original messages and turn it into a RFC2822 attachment.
L> Prepend your information into the NEW message that has the original
L> as the attachment.  This is how SpamAssassin works and I think is,
L> reasonably, the ONLY way this will be workable.

This also happens to be what Bart Schaefer said the day
before yesterday in the recent threadlet I already pointed you
at.  Bart also offered his excellent code to do just that as
an INCLUDERC plug-in.

Dallman

[Sokol, Ryan - 244] 
Thanks for the help and code.  I tried your auto responder and it worked
just fine.  After all these possibilities, I think I'll take the
approach of creating my own attachment with the database looked up
information and add it onto the original email (kind of the SpamAssassin
approach).  That way the look and feel of the original email is
preserved and replies to the original will not contain the looked up
information.

Thanks guys for your help.  Sorry for not posting correctly.  I'm new to
posting to mailing lists.  I usually just read them.


____________________________________________________________
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