procmail
[Top] [All Lists]

Re: My growing list of bad domains

1997-04-13 19:23:00
"Timothy J. Luoma" <luomat(_at_)peak(_dot_)org> writes:
I now have 110 domains that I refuse to accept mail from.

I have been using this:

[deleted for brevity]

I would like to dump the messages if any of these hosts are found  
in any of these headers:

From
Received
From:
Message-ID:
Return-Path:
X-Sender:

Is there a way to put all the domains in a separate file (which  
would be easier to maintain) and have them match any of those  
headers?


As has been suggested on this before, this is a good use for fgrep:

        :0
        * ? fgrep -f file-o-domains
        /dev/null


Now _that_ recipe looks for the domains in *any* of the headers.  If you
want to limit it to just a few, then you can do:

        :0
        * ? formail -x"From " -xReceived: -xFrom: -xMessage-Id: \
                        -xReturn-Path: -xX-Sender: | fgrep -f file-o-domains
        /dev/null


Or maybe this would be better:

        :0
        * ? formail -ISubject: -ITo: -ICc: -IResent-To: -IResent-Cc: \
                        | fgrep -f file-o-domains
        /dev/null


Your choice.

Philip Guenther

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