procmail
[Top] [All Lists]

Re: Generic mailing list detection?

2002-07-18 10:33:21
From: Brad Forschinger <bnjf(_at_)optusnet(_dot_)com(_dot_)au>

But what about getting the actual list name when there's a -owner or -admin
appended?  That's why I resorted to using the Perl filter: I couldn't figure
out a way to use \/ and $MATCH to grab (list-name)-owner@(hostname.dom).
Here's how my mail directory is looking at the moment

A mild trick suffices.  We only need remember that there could also be
legit hyphens in the addresses, so we must use a little care.

        :0 flags
        * ^Header-Name:.*\<\/[a-z0-9_+=-]+@
        * MATCH ?? ^^\/.+[^-]+-
        * MATCH ?? ^^\/.+[^-]+
        { MYRESULT = $MATCH }

First we got rid of all up to the last -.  Then we got rid of that.

Here is a verbose log from a test-harness run:

procmail: Assigning "MATCH="
procmail: Matched "this-is-my-list-owner@"
procmail: Match on "^From:.*\<\/[a-z0-9_+=-]+@"
procmail: Matched "this-is-my-list-"
procmail: Match on "^^\/.+[^-]+-"
procmail: Matched "this-is-my-list"
procmail: Match on "^^\/.+[^-]+"
procmail: Assigning "MYRESULT=this-is-my-list"

Acknowledgments to David Tamkin for first teaching me this method
a couple of years ago.

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