procmail
[Top] [All Lists]

Re: Prioritizing matching of "best" header

2004-09-11 05:48:04
Toen wij Bob George kietelden, kwam er dit uit:

:0
* !^\/Delivered-To: mailing list .*
{
        :0
        * !^\/List-Id: .*
        {
                :0
                * !^\/List-Unsubscribe: .*
                {
                        :0
                        * !^\/(X-)?Sender: .*
                        {
                               :0
                                * ^\/From: .*

I see no difference between that and what you had first, 
but that your match-operators are at the start of the line.

I use a variation on Sean's code:

    OR = 987654321^0
    List_Name # unset

    :0
    *$ 1^1 ^(Sender:[   ]*owner-|X-BeenThere:[  ]*|\
             Delivered-To:[     ]*mailing list )\/[-a-z0-9_+]+
    *$ $OR ^(Sender:[   ]*owner-|X-BeenThere:[  ]*|\
             Delivered-To:[     ]*mailing list )[-a-z0-9_+]+
    *$ $OR ^(List-Post:[        ]*(<mailto:)?|\
             X-LSV-ListID:[     ]*|\
             List-Owner:[       ]*(<mailto:)?owner-)\/[-a-z0-9_+]+
    *$ $OR ^Sender:.* List"? <(mailto:)?\/[-a-z0-9_+]+
    { List_Name = "$MATCH" }
    :0E
    * ^Sender:[         ]*\/[-a-z0-9_+]+-owner
    {
      :0
      * MATCH ?? ^^\/.*-
      * MATCH ?? ^^\/[^-]+(-+[^-]+)*
      { List_Name = "$MATCH" }
      :0E
      * MATCH ?? ^^\/.*-
      * MATCH ?? ^^\/[^-]+(-+[^-]+)*
      { List_Name = "$MATCH" }
    }

Just yesterday I updated this, when I received a message that had more 
than one X-BeenThere header, to use the last=oldest one.

-- 
Grtz, Ruud

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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