lists.darkspire.net (List Help) Filtering list messages

Filtering list messages

Contents

  1. Filtering list messages
  2. Procmail
    1. One recipe to rule them all
    2. Single list
  3. General

Filtering list messages

If you get a decent amount of email, chances are you'll want to filter mailing list messages into their own mailboxes so they do not "mix in" and interfere with your regular personal messages.

Below are examples for procmail and general notes for client-side filtering.

Procmail

procmail is the world's more versatile and robust mail processing program, period. Here are some recipes you can use to filter one ore more lists.

One recipe to rule them all

If you are subscribed to multiple lists hosted here, you can use this catch-all method. This will file each mailing list in it's own mailbox under a directory named lists-darkspire.

MKDIRS        = /usr/local/bin/mkinstalldirs

:0H
*   ^From +.*@lists\.darkspire\.net
*   ^Sender: +owner-\/[-a-zA-Z0-9_.]+
{
        FILE = lists-darkspire/$MATCH
        DIR = `/usr/bin/dirname $FILE`
        :0 icw
        * !? test -d $DIR
        | $MKDIRS $DIR

        :0:
        $FILE
}

MKDIRS needs to be assigned to a program that can make a directory hierarchy (or tree), such as mkinstalldirs, or mkdir -p on some systems. If you create the directory ahead of time, you can reduce this a bit:

:0H:
*   ^From +.*@lists\.darkspire\.net
*   ^Sender: +owner-\/[-a-zA-Z0-9_.]+
lists-darkspire/$MATCH

Single list

To filter a single list you can use the following:

:0H:
*   ^From +.*@lists\.darkspire\.net
*   ^Sender: +owner-LISTNAME@lists\.darkspire\.net
_LISTNAME

Replace LISTNAME with the name of the list. The list will be delivered to a mailbox called _<nameofthelist>. The underscore (_) is optional, I like to use this convention to indicate the file is a mailing list filtered with procmail.

General

Most people will opt for client-side filtering, as it's much easier for non geeks to use.

There's a few ways to do this, the most straightforward is to filter based on the Sender and List-Post headers.

Sender: owner-LISTNAME@lists.darkspire.net
List-Post: <mailto:LISTNAME@lists.darkspire.net>

In an announce-only list, the List-Post header may be different depending on how the owner of the list has set it up. You can use the List-Home, List-Subscribe, or List-Unsubscribe header in that case.

$Revision: 1.1 $
$Date: 2001/10/24 16:49:59 $

Help
· Help & Docs