procmail
[Top] [All Lists]

Re: How to filter

2001-04-13 14:53:46
On Fri, Apr 13, 2001 at 01:02:15PM -0600, Irwan Hadi wrote:
I'm curious how do I filter someone's message with procmail, with syntax like
From: "whatever" <whoever(_at_)host(_dot_)domain>

I've tried to filter like

* ^FROMwhoever(_at_)host(_dot_)domain
it doesn't work at all
I tried
* ^From: <whoever(_at_)host(_dot_)domain>
it doesn't work either

You need to use regular expressions (man regexp). Try
something like:

    * ^from:.* <whoever(_at_)host\(_dot_)domain>

The ^ at the beginning ties the following letter to
the begining of the line. A . (dot) matches any single
character, while a * matches 0 or more of whatever the
previous character was (called an atom), so the .* matches
0 or more of anything. The \ escapes the character that
follows, in this case causing it to interperet the following
. as a period and not as the special wildcard character I
mentioned above. Also note that matching is normally case
insensitive.

-- 
John Patton                      patton66(_at_)home(_dot_)com
Get my GnuPG public key: finger john(_at_)24(_dot_)22(_dot_)215(_dot_)225

"They couldn't hit an elephant at this dist..."
- General John B. Sedgwick Last words, 1864
_______________________________________________
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>