[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: feature request for this mailing list



On Thu, Mar 06, 2014 at 07:24:36PM +0000, Tom Furie wrote:
> This is the snippet from my .procmailrc for handling Debian mailing
> lists. Each list gets sorted into it's own directory.
> 
> :0
> * ^List-id: <debian-.+\.lists\.debian\.org>
> * ^List-id: <debian-\/[^\.]+
> $MAILDIR/.Debian.$MATCH/

The only problem with that is that anyone can send you a mail with a
list-id header containing some encoded chars that you would not want
procmail to put verbatim into a file or folder name. A slightly safer
solution is (from http://jmtd.net/log/list_filtering/)

  :0
  * ^List-Id:.*debian.*lists\.debian\.org
  {
    :0
    subst=| echo "$MATCH" | sed 's/\([A-Za-z0-9-]\+\)\..*/\1/'
    
    :0
    $MAILDIR/$subst/
  }

(note that my variation also removes dots, you may wish to tweak).


Reply to: