procmail
[Top] [All Lists]

RE: checking against blacklist

2002-09-29 11:54:18
Axel Heinrici wrote:

Am Sonntag, 29. September 2002 16:08 schrieb Dallman Ross:

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

I implemented this now. What do I have to put into the 
brackets in the "* ! ^In-Reply-To:.*[^        ]"-line. This is 
not clear to me. I tried it this way:

"* ! ^In-Reply-To:..." so the line is not allowed to be empty 
after the ":"

What I wrote in the comment on the initiating line to the
recipe I proposed is what goes in there.  In other work, something
not blank: the initial caret signifies "not" to the character class
within brackets; and the space and tab in there represent a class
of blank things.  So "something not blank" is what we're trying to
match.  However, I got confused by the double-negatives in
your sentence explaining what you wanted.  I think we need
to remove the bank ("!") now from the line:

        * ^In-Reply-To:.*[^     ]

If we find something not-blank somewhere to the right of the colon,
we're "in like Flynt" (that's an old English idiom implying success
of the mission).

Your three dots are not rigorous enough.  What if I have an In-Reply-To:
header with lots of whitespace but nothing else thereafter?



The rest of your proposal is a mess; unfortunately, I didn't
save the posted reply to Sean that showed your current version.

A mess? Hm. 
I'll try to explain more clear. I hope you will still help me.
This is the dubious set of the two recipes: 

:0 Whc:
| egrep  -f .falscheReplies
|egrep -E Message-ID: |awk -F " " '{print $2}' >>.falscheReplies

The last line is a repeat of what we had already above.  Why
don't we just save the Message-ID once up-top and re-use it
all we want later?

Here is something copied-and-pasted right out of my main .procmailrc:


        SPACE = " "
        TAB   = "       "
        WS    = "$SPACE$TAB"   # N.B.: Occasionally, the order can
matter


                      :0  # find Message-ID:
                       * ! ^Message-ID:
                       { MSGID = MISSING! }

                      :0 E  # < + chars + @ + chars + > + EOL
                       * $ ^Message-ID:.*\/<[^$WS<>@]+(_at_)[^$WS<@]+
                       *    MATCH ?? ^^[^>]+>^^
                       { MSGID = $MATCH }

                      :0 E
                       { MSGID = [illegal] }



            logtext = "MSGID is >$MSGID<"
            LOG = "$arrow_L $logtext"


Okay, now let's test your list and respond accordingly:

        :0 hc:  # I see no reason for the W or w flags, so left them out
        * $ ! ? grep -qsx '$MSGID' .falscheReplies
        | echo $MSGID >> .falscheReplies

:0 Wh:
| egrep  -f .falscheReplies
listen-reste/


              # we don't need a lockfile for MH-style directory saves
        :0 A  # `A' means inherit conditions from (my) above if recipe
triggered
        listen-reste/
        

 
I think I got the problem now. *clap my hand at my forehead*
The message ID alone is not the correct regexp to match the mail.:-)
I will have to do this a little more clever.
The best idea is probably to do this in a separate script. 
Or is there something implemented in procmail to read files?

I'm still not entirely clear on what you are trying to do, exactly.
Oh, well.


One more question:
return-code=0 tells procmail to use the action line in current recipe
return-code=1 tells procmail to skip current recipe

right?

If I understand you right, yes: right.  :)



p.s. your mail does not contain an "In-Reply-To:" in the header.
Why?

Why do you think it should?

Many people view there mail folders sortet by threads. Missing 
"In-Reply-To:" in the header destroys this threading. There are 
mailinglists with more then 200 mails per day. Correct threading is 
essential there.

Well, let's see: the two main MUAs I use are Berkeley Mail (mailx.att) 
under NetBSD and Outlook 10 under Win XP.  Neither one natively inserts
such a header when I reply to your mail.  In Berkeley Mail, I could
manually add one if I felt so inclined.  Not sure what you'd want me
to add, however. :)

In short, how can you dictate the mail client your correspondent will
use?  At best, you can only choose not to read his mail, if that's
what you'd prefer.

-- 
dman

_______________________________________________
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>