2 messages in net.sourceforge.lists.courier-maildrop[maildropl] pattern matching issue
FromSent OnAttachments
Robin BowesApr 15, 2003 2:57 pm 
Robin BowesApr 15, 2003 3:00 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[maildropl] pattern matching issueActions...
From:Robin Bowes (robi@robinbowes.com)
Date:Apr 15, 2003 2:57:48 pm
List:net.sourceforge.lists.courier-maildrop

Hi,

I'm using a modified version the code posted by Robert Fleming/William Pietri to
match mailing lists:

if ( /^List-Id:.*<![:alnum:]*\-?[:alnum:]*\-?[:alnum:]*\-?[:alnum:]*!.*>/ || /^X-list: ![:alnum:]*/ || /^Mailing-List: contact ![:alnum:]*\-?[:alnum:]*!-help@.*/ || /^Mailing-List: list ![:alnum:]*\-?[:alnum:]*!@.*/ || /^Sender: owner\-![:alnum:]*\-[:alnum:]*!@cyrusoft.com/ || /^List-Post: <mailto:![:alnum:]*/) { exception { to .${LISTS_FOLDER}.${MATCH2}/ } }

The issue is that [:alnum:] is the same as [0-9A-Zz-z], but the local part of
the e-mail address can include all the following characters:

(I've deliberately not considered quoted text - too hard!)

What would be useful would be another shorthand notation which represents all
valid characters for the local part of an e-mail address, e.g. [:mailchars:].

For the time-being, the following changes seem to do the trick, and tidy things
up a little:

if ( /^List-Id:.*<![0-9A-Za-z_\-]*!/ || /^X-list: ![0-9A-Za-z_\-]*!/ || /^Mailing-List: contact ![0-9A-Za-z_\-]*!-help@.*/ || /^Mailing-List: list ![0-9A-Za-z_\-]*!@.*/ || /^Sender: owner\-![0-9A-Za-z_\-]*!@cyrusoft.com/ || /^List-Post: <mailto:![0-9A-Za-z_\-]*/ || /^List-Subscribe: <mailto:![0-9A-Za-z_\-]*!-subscribe@.*/ || /^Return-Path: <owner-![0-9A-Za-z_\-]*!@.*>/ ) { exception { to .${LISTS_FOLDER}.${MATCH2}/ } }

Note that I've added an additional pattern to catch ezmlm lists (List-Subscribe)
and a further pattern to catch an old list I subscribe to that doesn't seem to produce any sort of Mailing list headers
except Return-Path: which is in the form "Return-Path: <owner-listname@host.domain>"

R.