procmail
[Top] [All Lists]

Re: Need recipe to match ALL-NUMERIC addresses @whatever

1997-08-25 22:43:59
At 08:06 PM 8/25/97 -0700, you wrote:
I'm in dire need of a recipe that will match an all-numeric address from
whatever domain sends it...  And I'd prefer a purely procmail recipe, if
possible!

You may guess my reason:  There's a rash of NEW spamming from cyberpromo
(YES!, it DOES come from them, since any valid addresses IN the msg. body
are at answerme.com), and it's being realyed from all over, using faked &
real domains, but with faked addresses at those domains ... using a simple
random number generator...

So, what I need to match is stuff like:

143671(_at_)msn(_dot_)com
03985932865(_at_)mci(_dot_)com
38957272(_at_)compuserve(_dot_)com
(etc)

But NOT match on address with OTHER than numbers in the user part of the
address, IE:

25463(_dot_)254(_at_)compuserve(_dot_)com
652-2546(_at_)mcimail(_dot_)com


This may be a stupid question for some of you, but right now I'm clueless on
how to match the varying number of digits.

(DISCLAIMER: I sure hope I didn't blow it here, but it wouldn't surprise me
[although I thought I *did* test it out well].  These greedy regexps can be
difficult for me to follow and anticipate all possibilities.)

I will assume you are looking to match the "From: " header (or the
"Reply-To: " header if it exists), but this should be easily modified for
your particular need:

Better option:

        FROM=`formail -rtzc -x'To:'`

        :0
        * FROM ?? ? grep -v ".*[^0-9].*@"
        {
                ACTION DESIRED
        }

Alternative option:

        :0
        * !^(From|Reply-To): +.*[^0-9].*@
        {
                ACTION DESIRED
        }


Lates!
---------------------------------------------------------------------------
Tim <bodysurf(_at_)pobox(_dot_)com>                          
mailto:bodysurf(_at_)pobox(_dot_)com
Finger bodysurf(_at_)pobox(_dot_)com for my PGP public key (Bits 1024/KeyID 
09DA5C49).
PGP Key FPrint (09/03/94): 4C 97 F1 FA 70 55 68 91  49 D1 AD F2 DD 63 0C 15
---------------------> Please PGP encrypt your email <---------------------