procmail
[Top] [All Lists]

Re: more ideas for distribution list reqd please

2004-03-30 15:45:02
At 22:39 2004-03-30 -0700, JM Fraser wrote:
I posted this sometime before but it has not worked. I am looking for a way
to specify a single rc.file which would contain a list of names which would
be referenced, in full, before procmail deposits the mail into a maildir.

For example:

:0
*^From:(_dot_)*mail(_at_)domain1(_dot_)com
and
*^From:(_dot_)*mail(_at_)domain2(_dot_)com
and
*^From:(_dot_)*mail(_at_)domain3(_dot_)com
Mailbox/

I was advised to use the "and" quotes as this would force procmail to visit
each line before depositing the mail. Well this does not work.

Forthwith, ignore whomever directed you to use the "and" clause - there's no such thing in procmail.

By convention, multiple conditions lines ARE anded. Which means *ALL* of them need to match. This is rather unlikely what you want (there really should be only ONE address in the From: field). Instead, you want OR. OR can be done like so:

:0
*^From:.*(mail(_at_)domain1(_dot_)com|mail(_at_)domain2(_dot_)com|mail(_at_)domain3(_dot_)com)
Mailbox/

Or, using line continuations, which would place each address on a separate line:

:0
*^From:.*(\
        mail(_at_)domain1(_dot_)com|\
        mail(_at_)domain2(_dot_)com|\
        mail(_at_)domain3(_dot_)com)
Mailbox/


Or, you could use scoring, but that might complicate matters for you.

PS: Also, where could I specify a global .procmailrc file where I could add
various rc.files for all users?

/etc/procmailrc

Depending upon your OS arrangement, it might be:

/usr/local/etc/procmailrc

It'd be a REALLY good idea to THOROUGHLY debug your recipes before subjecting all users to them.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


_______________________________________________
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>