procmail
[Top] [All Lists]

RE: Recipe stops processing early

2003-12-29 01:17:51


From: Lee Hoffner
Sent: Sunday, December 28, 2003 7:50 PM

I have the following recipe to deal with a list that hits my ISP:

#### ISP spam ####
:0 :

This initial lockfile (trailing ':') is likely unnecessary.

* ^To:(_dot_)*(_at_)ispdomain[(_dot_)]net
{
  :0 hw
  SPAMMER=|formail -r |formail -x To:


The :0 hw is unnecessary. A simple assignment will do:

SPAMMER=`formail -rzxTo:`

  :0
  | echo "$SPAMMER" >>spammerlist


That's a delivery recipe. If you wanted to keep going with an additional
copy than add 'c' as follows:

:0 c
| echo "$SPAMMER" >>spammerlist
:0 c
| echo "`date`: The ISP junk mail list hit again! ($SPAMMER)" >>delete.log


But that's complicated, and you're not even reading the original message
anyway. It might be easier to set TRAP, and have procmail run those actions
after it completes delivery to SPAM.

Rewriting:

#### ISP spam ####
:0
* ^To:(_dot_)*(_at_)ispdomain[(_dot_)]net
{
  SPAMMER=`formail -rzxTo:`
  TRAP='echo "$SPAMMER" >> spammerlist
echo "`date`: The ISP junk mail list hit again! ($SPAMMER)" >> delete.log'
  :0:
  SPAM
}

(using a couple of David T's tips.)



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

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