« The Dragonbone Chair | Main | Anyone for some FTJava? »

July 23, 2003

Sorting Mailing Lists with Procmail

Bill writes about the usefulness of list header metadata, so I thought I'd put up the procmail recipies I use to catch mailing list emails.


 # Yahoo Groups
 # (e.g. Mailing-List: list mt-dev@yahoogroups.com)
:0:
* ^Mailing-List: list \/[^@]+
lists/$MATCH

 # Mailman and other intelligent software lists
 # (e.g. List-Post: <mailto:Pluginmanager-l@rayners.org>)
:0:
* ^List-Post: \<mailto:\/[^@]+
lists/$MATCH

 # Other list software?
 # (e.g. X-Mailing-List: <ftjava-test@firedrake.org>)
:0:
* ^X-Mailing-List: \<\/[^@]+
lists/$MATCH

 # Mojo Lists
 # (e.g. List: lug)
:0:
* ^List-Software: Mojo Mail
* ^List: \/[^@]+
lists/$MATCH

 # ListProc (all those UMBC lists)
 # (e.g. Sender: owner-umbclinux@listproc.umbc.edu)
:0:
* ^Sender: owner-\/[^@]+
lists/$MATCH

 # More lists (realms-l)
 # (e.g. From owner-realms-l@ORACLE.WIZARDS.COM)
:0:
* ^From owner-\/[^@]+
lists/$MATCH

Most of the mailing list software out there adds the headers and I can catch them relatively easily. With others, however, I have to do a little digging. And the realms-l list drives me insane. Here's how it identifies itself within the email:

Sender: The Forgotten Realms Mailing List <REALMS-L@ORACLE.WIZARDS.COM>

I suppose I could look for that specifically, but that's exactly the point. I shouldn't have to write filters for specific mailing lists. It defeats the whole purpose of putting the list data in the email headers.

Anyways, for all you procmail/regexp experts out there, how do you think I could handle this odd case:

Sender: port-sgimips-owner@NetBSD.org

Posted by rayners at July 23, 2003 05:12 PM

Trackback Pings

TrackBack URL for this entry:
http://mt.rayners.org/mt-tb.cgi/229

Listed below are links to weblogs that reference Sorting Mailing Lists with Procmail:

» Email Filtering from fozbaca.org
Filtering Mail FAQ to go along with Sorting Mailing Lists with Procmail.... [Read More]

Tracked on October 2, 2003 02:59 PM

Comments

Procmail's match operator can't pick out the stuff between "Sender: " and "-owner". I'd use the simple "^Sender: \/port-sgimips". That works, though is definitely suboptimal because you must make a recipe for each such list. To automatically catch new lists you could add a catch-all recipe which matches "^Sender: \/.*-owner" - so while new lists would have "-owner" in the filename, at least the traffic would be caught and put into a file specifically for that list.

Posted by: Mike Rose at August 22, 2003 10:56 AM

:0: * ^Sender: \/[^@]+ lists/echo $MATCH | sed -e 's/-owner//'

Posted by: Jesse at September 5, 2003 06:02 AM

Post a comment




Remember Me?

(you may use HTML tags for style)