procmail
[Top] [All Lists]

Re: Q: Putting action line in variable

1997-08-09 17:09:00
On Sat, 9 Aug 1997, David W. Tamkin wrote:

Gregory Sutter asked,

| I want to put the entire action line for a set of recipes in a variable, as:

| # This sets the default action for all recipes in this base junkfilter file.
| ACTION="|formail -i 'X-Fkey: junk' -i 'X-Spammer: `echo $SPAMMER`' >> jmtest"

I think what you really need is a different approach:

 SPAMMER # make sure it goes in unset

 :0
 * ^Received:.*(Cyber-Bomber|bulk_mailer|from stealth)
 { SPAMMER="junkmail software" }

 :0
 * ^X-Advertisement:.*iemmc
 { SPAMMER=IEMMC }

 ... etc. ...

 :0: # if $SPAMMER has been given a non-null value
 * SPAMMER ?? .
 | formail -i 'X-Fkey: junk' -i "X-Spammer: $SPAMMER" >> jmtest

That would cause procmail to go through the entire ruleset every time,
though.  Well, that's what it does on legit mail anyway... That seems
like a good idea.  You get the "star of the day" award for helping me
improve my junk mail filters.  Thanks!

GReg

--
junkfilter, procmail-based junk email filter, available at
http://www.pobox.com/~gsutter/junkmail/

Gregory S. Sutter                       "How do I read this file?"
mailto:gsutter(_at_)pobox(_dot_)com                "You uudecode it."
http://www.pobox.com/~gsutter/          "I I I decode it?"

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