procmail
[Top] [All Lists]

Killing mail by country

2000-01-03 06:34:48
My spam filters be getting a bit large for what I want to do.

Mainly, block email from countries where the spam is coming these days.  
And then tell me why the email was offensive.  What I have is a series of
filters that look like this:

:0
* ^Received:.*\.cn[     ]
{
 LOG= "Reason: I don't know anyone in china. $N"

 :0
 /dev/null
}

Now, I know I can do something like:

* ^Received:.*\.\/(cn|nl|jp)[^  ][      ]

And then do

LOG= "Reason: I don't know anyone in $MATCH. $N"

Is there an easy way to find the correct country for the value in $MATCH?
I know I can do it with something like:

COUNTRY=|`grep $MATCH list-of-countries | awk '{print $2}'`

Or use sed or perl to do the same thing.  Is there a better way to do
this?


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