In your message regarding Exiting from Procmail after each recipe dated
Tue, 26 Mar 2002 00:20:27 -0500, S. Morgan Friedman said that ...
Hi all -
I have a procmail question regarding my home-grown anti-spam filter.
I have a whole slew of filters to look for spam, all of them following a
standard formula:
:0
* ^Subject:.*(viagra|loan approval)
spam
etc. Now I would like to change all these recipes so that instead of
putting it into a folder called "spam", I'd like to merely add a header
identifying it as spam then place them in the default mailbox. I can do
this for one e-mail along the following lines:
:0f
* ^Subject:.*(viagra|loan approval)
| formail -I "X-Category: Spam"
Okay, so far so good. But the problem I'm running in to is that once my
filter identifies an e-mail as spam, and adds in a header identifying it as
such, I'd like it to place the message in the default mailbox and then exit
procmail. That is to say, my recipes are ordered in a significant way, so
that once it is identified as spam, it would be problematic for a later
recipe to evaluate whether it is spam or not. (Not to mention the added
inefficiency of continuing going through all the recipes once we've already
done with it what we want.)
Try This:
:0fh
* ^Subject:.*(viagra|loan approval)
| formail -I "X-Category: Spam"
:0A:
spam
The :0A: means if the previous receipt is true then lock and deliver to
spam. I think it is less overhead to use the "h" flag in the first receipt
as well.
--
Best Regards,
Tim Rice
---------------
Stationery & Stuff
Phuket Thailand
http://www.thaistuff.com
http://www.computerstuff.net
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail