procmail
[Top] [All Lists]

Re: Problem with matching From .net.com and others

1998-01-07 15:21:32
On Wed, 7 Jan 1998 09:55:50 -0500,
Laurence Michaels <lmichael(_at_)esun19(_dot_)gdc(_dot_)com> wrote:
On Tue, 6 Jan 1998  21:57:18 +0200, Era Eriksson wrote:
On Tue, 6 Jan 1998 09:08:20 -0500, Laurence Michaels
<lmichael+procmail(_at_)esun19(_dot_)gdc(_dot_)com> wrote:
I'm trying to match on email From something like any one of the
following:
someone(_at_)test(_dot_)net(_dot_)com
someone(_at_)test(_dot_)com(_dot_)com
<...>
Looks like what I want is probably the
FROM=`formail -rtzxTo:`
:0
* ... other conditions
* 100^1 FROM ?? \.(net|com|edu)\.([-a-zA-Z0-9]*\.)?com
action
(Note: I modified the last parenthesized expression from
(.*\.) to ([-a-zA-Z0-9]*\.) as suggested.)

This is pretty much redundant here because at this point, FROM will
only contain the actual e-mail address, and no whitespace or comments.
You might want to anchor this, though, to make sure you are only
looking at the domain part of the address, and a terminating ".com"
(instead of the .com in ".command.net", for example):

    * 100^1 FROM ?? @(.*\.)*(net|com|edu)\.(.*\.)?com$

Though I will be using '-r...' instead of '-rt...',
since this particular line is going in one of my
'detect suspiciously spammish messages' filters,
and I can't trust any apammer to use valid headers.

The manual is a bit misleading when it talks about "trust" in this
context. It's virtually as easy to forge a From: or From_ as it is to
forge Reply-To:. The formail source has the exact details (the chart
is also available at <http://www.iki.fi/~era/procmail/formail.txt>)

/* era */

-- 
 Paparazzi of the Net: No matter what you do to protect your privacy,
  they'll hunt you down and spam you. <http://www.iki.fi/~era/spam/>

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