procmail
[Top] [All Lists]

Re[2]: filtering recipe and local mailbox

2001-09-24 22:47:27
Tuesday, September 25, 2001, 02:09:47 PM, Timothy J. Luoma wrote:

: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 .*

i rewrote my recipe using

:0:
* ^Sender: owner-freebsd-questions
freebsd/questions

as suggested by Lawrence (above) and all the other freebsd-* lists and
it seems to work the first time around. the second time fetchmail was
called, __none__ of the mails were filtered __at all__. i am still
figuring out where i did wrong. as i'm using mutt, (and probably OT for
this list), it (mutt) complains that /var/mail/$USER is not a mailbox?!
there __are__ mails in /var/mail/$USER but they do not start with a

"From: list/person-name <date> <time> "

value which mutt thinks is not a valid mailbox. strange.

mailstat ~/Procamil/log seems to be processing fine but theres no new
mails. (invisible mails?)

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

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

i like this rule (easy) but havent tried it out yet since i'm still
having problems with the above.

(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.

this rule is even better and i'll probably have a go at it as well but
till i get the problem fixed...

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



thanks for all the help and tips.


~as

-- 
Alvin alsim3(_at_)yahoo(_dot_)com


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

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