procmail
[Top] [All Lists]

Re: Prioritizing matching of "best" header

2004-09-11 07:21:23
Toen wij David W. Tamkin kietelden, kwam er dit uit:

The code you [=Bob] have there sets its own
priorities, overriding the earliest-in-the-text precedence that
procmail would have used if you had a condition like this:

* ^(Delivered-To|List-(Id|Unsubscribe)|(X-)?Sender): \/.+

where the order of appearance of header lines in the message itself
would matter.

Yes, good observation. I use a multi-layered approach:
1. detect if the message is probably from a list
2. derive the Listname from the headers
3. find the Listname in a list-of-Listnames, and 
   store the message in a common List-box if not found 
   (and in the Listname's box if found)

1.
  :0
  *$ $OR ^(X-)?List-.*:
  *$ $OR ^Precedence:.*(bulk|junk|list)
  *$ $OR ^X-Mailer: Accucast
  { ListMsg=T }
  :0E
  {
    # Check the address in the From_header against 
    # a regex, build with sed from a file with 
    # entries like:
    #   @sans.org:tech
    #   slashdot(_at_)slashdot(_dot_)org:tech
    # The part after the ':' is later used as the Listname.
  }

My list-sorting-code performs pretty well, but adding 
scoring to it would definitely make it more predictive.

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