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 | Comments (2) | TrackBack

July 08, 2003

Filtering Bug Reports from the MT Plugin Directory Bug Tracker

I love procmail. I just spent a few minutes playing around with my ~/.procmailrc file and now any bug reports I get from the MT Plugin Directory Bug Tracker are now placed into ~/Mail/bugs/Project Name.

Here is the relevant portion of my ~/.procmailrc file:

# Catch bug reports from bugs.mt-plugins.org
:0:
* ^From: plugins@mt-plugins\.org
{
        :0 B
        * ^Proje[ck]t: \/.+
        bugs/`echo "$MATCH" | sed -e 's/ /_/g'`
}

And from my ~/.muttrc file to see all those mailboxes:

mailboxes `for file in ~/Mail/bugs/*; do echo -n "=bugs/$(basename $file) "; done`

Update: (2003-06-08 18:14)

Thanks go to Mike for the suggestion. So, here's the updated recipe:

# Catch bug reports from bugs.mt-plugins.org
:0:
* ^From: plugins@mt-plugins\.org
* B ?? ^Proje[ck]t: \/.+
bugs/`echo "$MATCH" | sed -e 's/[^-_A-Za-z0-9]/_/g'`

Posted by rayners | Comments (0) | TrackBack

Entry List