procmail
[Top] [All Lists]

forwarding to two places, and appending info to header

2002-11-21 08:47:30
Hi, 
I've recently written a .procmailrc and have been enjoying the control it
gives me over spam, forwarding options, etc.  I'm a newbie so forgive me if
this is an FAQ; I've scoured the archives with no success so far.

I read my mail in a shell account and also split forward it to a web mail
account for reading attachments and html stuff.  Currently I catch my
"approved" email this way:

    # check the "live" list for approved addresses and header keywords
    :0c:
    * ? formail -x"From" -x"From:" -x"Sender:" -x"Reply-To:" -x"Return-Path:" 
-x"To:" -x"Received:" -x"Subject:" | grep -iF --file=live.txt
    ${MAILDIR}/regular.mail

    # Also forward it to web mail (how to combine both actions?)
    :0
    * ? formail -x"From" -x"From:" -x"Sender:" -x"Reply-To:" -x"Return-Path:" 
-x"To:" -x"Received:" -x"Subject:"| grep -iF --file=live.txt
    !blisterpeanuts(_at_)yahoo(_dot_)com

    # Now check the "kill" list...

This works fine, but is there a way I can refactor these two actions into one
simple statement?

My second question concerns modifying the subject line.  Yahoo lets you filter
on subject lines but nothing else, so I figure if I can append some string to
the subject line of my forwarded mail, I can filter that into the inbox and
filter everything else into bulkmail.  Hence:
       Subject:  Your Verizon Bill
would become 
       Subject:  Your Verizon Bill [*FWD*]
Or something similar.  How do you do this using the ! notation as described
above?  I've tried -I"Subject: ${SUBJECT} ${TAG}" but it doesn't work in that
context.  What does work (but is useless to me) is the following:

:0fhw
| formail -I "Subject: ${SUBJECT} ${SUBJECT_TAG}"

I've seen the $SENDMAIL -t syntax in the archives and this seems to allow me to
filter through formail.  Am I going to have to switch from the | syntax to
this?  Why does | work in the first place?  Is it just a shorthand for
sendmail?

Thanks for any tips leading to the arrest and successful prosecution of all
spam!!!

Terry


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail