procmail
[Top] [All Lists]

Re: filtering recipe and local mailbox

2001-09-24 08:06:59

:0:
* ^TO_cvs-all
* ^From:.owner-cvs-all
* ^Sender:.*cvs-all
freebsd/cvs-all

The Sender line (or other fixed line) is probably best,  because you don't need 
to use a .*

However if you wanted to OR these, it would look something like this:

:0:
* ^(To|Cc|From|Sender):.*cvs-all
freebsd/cvs-all

(See below for why I didn't keep ^TO_)


Additionally, the ^TO_ regexp is quite processor hungry, especially
when filtering list mail, it's probably better not to use it if you
can find a unique single header for that list.

Very true.... I generally find that

:0:
* ^(To|Cc):.*whatever
IN.whatever

does very nicely for me instead of ^TO_ or ^TO   .... yes it misses some cases, 
but they are rare enough for me not to care (esp. rare when dealing with list 
mail)

Assuming that several FreeBSD lists use the same format for Sender: lines, you 
can also use this to cover any of the lists you subscribe to:


:0:
* ^Sender: (owner-)?freebsd-\/.*
freebsd/$MATCH

So if the mail comes from:

Sender: owner-freebsd-stable
Sender: owner-freebsd-current
Sender: owner-freebsd-questions
Sender: owner-freebsd-chat

you will find each in their own mailbox (stable, current, questions, chat) from 
this one recipe.


BTW, as you are learning procmail, may I suggest this be your first recipe 
(after all variables but before any other filtering or delivery)

:0:
backup-all

that will save you from losing any email based on typos or following someone 
else's mistaken advice!

I've been using procmail for about 6 years and still use it!  It has saved my 
hiney, and my email, on more than one occasion!

TjL



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