procmail
[Top] [All Lists]

Re: newbie question

2003-01-16 16:26:59
At 15:25 2003-01-16 -0700, Michele Francis did say:
I have this working
:0
* ^ From:.*awsome.net|\
 ^From:.*m100.net|\
 ^From:.deals.com
/dev/null

Because this will match From: lines with m100.net anywhere in them, or deals.com as the beginning of the string after ONE of any character (like a space). The first of your regexps isn't likely to be matching anything - Header lines don't START with spaces.

Why doesn't this work?
:0
* ^ From:.*awsome.net
* ^From:.*m100.net
* ^From:.deals.com
/dev/null

Because this requires *ALL* of the conditions to match - the separate conditions are *AND'ed* -- that includes the one that can't possibly be matching anything in your headers, and the one not very likely to match anything.

You need to carefully check your syntax. I realyl hope you're running this under a SANDBOX test environment (see links in my .sig), and not on your regular incoming email. Don't learn on your inbox, or you're going to learn the HARD way. You should use logging and "VERBOSE=ON" to get details of the results of your filter and examine the logfile to see what it says about the regexp results.

BTW, dots intended to be dots should be escaped, because a dot by itself is a wildcard (which just happens to match a dot, but it'll match anything else as well).

Try this instead:

:0
* ^From:.*(awsome\.net|m100\.net|deals\.com)
/dev/null

There are other issues with how broad your original matching conditions are, but as this sat in my outbox for a few minutes, I see others have raised some of them already.

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