procmail
[Top] [All Lists]

Re: checking against blacklist

2002-09-28 15:18:03
From: Axel Heinrici <axel(_dot_)foley-beverly-hills(_at_)gmx(_dot_)de>

I want to generate a blacklist automatically and check mail agains
this list. The creation of the blacklist seems to work fine. I have
a file containing the message ID of each mail my rule assumes as
corrupted. I assume mails with a Subject beginning with "Re:" and

Before we get any further, can you clarify what good you think the
Message-IDs will do?  You do know they won't likely be repeated
in new mail (except in very odd or very broken cases), right?


not containing a non-empty "In-Reply-To:" line as corrupt. In other
mailinlists one gets several mails destroing the threading :-). The
following rule generates this list:

:0 c : #Falsche Replys markieren

Btw, I happen to speak German as well and English; I'm an American
living in Germany.  I don't want to make fun of "Germlisch"; in fact,
you write English very well, and this is not a criticism of your
ability to communicate in a foreign language.  I thought, all the
same, that I'd bother to point out that the plural of "reply"
would be "replies" in English.  So maybe you want your comment
and your file to read that way, I don't know.  :)

* ! ^[Ii]n-[rR]eply-[Tt]o:...$
* [Ss]ubject:.*[Rr]e:

You do not need the dual cases for your letters.  Procmail is
not case-sensitive until you tell it to be so with the D flag.
So the case stuff is not necessary.  (If it were, though, we'd
have a problem, because the RFCs do not prohibit the letters
past the initial one in header words from being upper-case, either.)


|egrep -E Message-ID: |awk -F " " '{print $2}' >>.falscheReplys


I still don't undertand why you want the Message-IDs; but supposing
that you really do, you don't need to pipe to egrep and then awk.
You can do this same thing totally within procmail, e.g.:

        :0 hic:  # caret, space and tab are in brackets below
        * ! ^In-Reply-To:.*[^   ]
        *   ^Subect:(.*\<)?Re:
        *   ^Message-ID:.*<\/[^>]+
        | echo $MATCH >> .falscheReplies



Afterwards I want to check the incoming mails against this list. Every 
mail coming in should be checked against containing this message-ID. 
Also Replies to the corrupt mail should be marked as corrupt by the 
next recipe. Then I want these mails to be dumped. I tried this way:

If you are going to check the same list right here, what will have stopped
a race condition such that the above action will already have completed and
you'll get a match on the very same mail?

:0 Wh:
| egrep  -f .falscheReplys
|egrep -E Message-ID: |awk -F " " '{print $2}' >>.falscheReplys
listen-reste/

I see PSE has answered the point about no multiple action lines being
allowed; so I'll stop here for now.

Tschuess
Dallman Ross

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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