procmail
[Top] [All Lists]

Re: Matches as folders

1999-04-21 02:46:04
On Wed, 21 Apr 1999 11:42:55 +1000, Bek Oberin
<gossamer(_at_)tertius(_dot_)net(_dot_)au> wrote:
:0:
* From: (_dot_)*(_at_)netizen(_dot_)com(_dot_)au
* From: \/[^(_at_)]+
netizen.$MATCH

This is perfect. My only comment is that you obviously want to be sure
that the From: field always begins with an address (no quoting, no
comments). For the record, below are some typical variations which
your current recipe will not deal correctly with -- but you know more
than I do about the mail you are in fact receiving, so perhaps this is
not a problem.

    From: "foo(_at_)netizen(_dot_)com(_dot_)au"
    From: Real Name <foo(_at_)netizen(_dot_)com(_dot_)au>
    From: <foo(_at_)netizen(_dot_)com(_dot_)au>
    From: <foo(_at_)netizen(_dot_)com(_dot_)au> (Real Name) (not very usual)
    From: "<foo(_at_)netizen(_dot_)com(_dot_)au>" (Microsoft braindeath)

If you want to deal with all of these cases, you will have to do
something like formail -XFrom: | formail -rtzxTo: to get at the email
terminus in the From: line.

Also you probably want a ^ anchor at the beginning of both conditions,
unless it's specifically designed to also match on e.g. Resent-From:
if present. (Remember that Procmail -- or actually any regex engine --
will sometimes do all kinds of tricks to find a match if there is one,
even if you really didn't want to find it. The solution is to always
be very specific about what you really want to find. But of course you
have to know your data and so forth in order to know where the regex
might match by accident, so to speak.)

Hope this helps,

/* era */

-- 
.obBotBait: It shouldn't even matter whether     <http://www.iki.fi/era/>
I am a resident of the state of Washington. <http://members.xoom.com/procmail/>
 * Sign the European spam petition! <http://www.politik-digital.de/spam/en/> *

<Prev in Thread] Current Thread [Next in Thread>