procmail
[Top] [All Lists]

Re: regex's

2002-04-18 06:40:56
Hello, I would like to know how to write this regex correctly: (it seem to
catch all email, doh)

* ^Received:* *from*
.*[mardox.com|urlomatic.com|db-hosting.com|bannerscape.com]

The main problem is that you are using square brackets rather than
parentheses.  Parentheses group things, square brackets define a
character class.  A character class saimply says "one of these
characters must occur at this position", and you provide a wide choice
:-)

You also have a couple of other things in there which maybe aren't doing
what you intended - ':*' will match 0 or more colons, 'm*' will match 0
or more 'm's.
Also the periods in the domain names will match any character rather
than just a dot - you want '\.' to match only a dot.
So maybe you want a condition something like:

  * ^Received:.*(mardox\.com|urlomatic\.com|db-hosting\.com|bannerscape\.com)

Hope that helps,
Martin
-- 
Martin McCarthy                 /</    http://procmail.non-prophet.org
    `Procmail Companion'        \>\
     Addison Wesley             /</                  PGP key available
_______________________________________________
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>