procmail
[Top] [All Lists]

Re: How to setup multiple From in .procmailrc

2002-03-29 14:15:44
At 18:16 2002-03-29 +0100, frbn did say:
this should work fine (not the finest)

:0
* ^From.*yahoo.com
* ^From.*aol.com
{
        :0c:
        temp
}

You have some bad ganja there.

This would be triggered only on a message From: *BOTH* domains, as each condition line is *AND'd*. If I got a message that matches this criteria, I'd promptly file it away as spam.

What gives with the inner ruleset just to dump it into a mailbox?  Unnecessary.


:0c:
* ^From:.*(juno\.com|aol\.com)
temp

or, if you want to optimize the regexp (after you have a *PILE* of domains all under the same TLD, you would want to):

:0c:
* ^From:.*\(((pacbell|somewhere|nowhere|juno|aol)\.com)|((sbcglobal|prodigy)\.net))
temp

or, if you wanted to explicitly or each line, to make it a bit easier to read (at least on the RHS), use scoring (see 'man procmailsc', and search the list archives for previous discussions about same - including "what does the big number mean?"):

:0c:
* 9876543210^0 ^From:.*juno.com
* 9876543210^0 ^From:.*aol.com
temp



Arguably, the regexp should include a condition prior to it that matches for a dot or @ symbol, so that you're not matching domains like:

        ihateaol.com

there are other slipups too - aol.com.sucks.com will match .*aol.com as well, but these are beyond the scope of the original query.


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