On Mon, Dec 29, 2003 at 06:00:38PM +0000, Bob Crandell wrote:
> >...but I don't generally like it.  I don't remember the .qmail filtering
> >syntax, but I remember that it wasn't as good as exim's and nowhere near
> >as good as procmail or similar.  If your qmail setup doesn't already use
> >procmail if available |procmail with whatever args are appropriate is just
> >a line away in your .qmail file..  ;)
> >
> This is supposed to be system wide.  What does your /etc/procmailrc file
> look like to create folders?

You're in luck!  My .procmailrc and associated files are designed to be
self-teaching for Debian developers, as once my .muttrc was.  Although the
way I use mutt has changed too greatly for my .muttrc to serve to help
pine users migrate (its original purpose), my .procmailrc is still largely
useful by people who need to filter their mail.

Please not the differences between what's "normal" and how I've set it up
here (to fit more in to the way NeXT and MacOS X do things):

$HOME/Mail      -> $HOME/Library/Mail/Folders
$HOME/.procmail -> $HOME/Library/Mail/Procmail
$PMDIR/log      -> "$PMDIR/Mail Log.txt"

You probably want to change these back.  ;)

Another weirdness that predates MacOS X is the location of my primary
inbox.  I don't have /var/mail/knghtbrd or ~/Mailbox or ~/Maildir or
anything of the sort.  I have $MAILDIR/Inbox, which is honestly a hell of
a lot more logical.  It was the one thing pine ever did right - your inbox
belongs with the rest of your folders.  (In pine's case, it was only
virtually so, but I can see no reason why not to make it actually so.
Obviously, don't do this if you use pine because it gets confusing..)
Anyway, here are my .procmailrc and my rc.maillists:


# Knghtbrd's .procmailrc
#
# Long, long ago on an ISP far, far away there was this newsgroup called
# teleport.support.unix.  In this newsgroup were many helpful people who
# taught me everything I ever needed to know about procmail.  They rocked!
#
# Most of what they taught me was kinda teleport-specific - you can't just
# filter on the envelope the way I do in my spam filter unless you feed the
# right stuff to procmail.  I'll mark any rules that require custom stuff
# and what custom stuff you need..  

# Set on when debugging
VERBOSE=off

SHELL=/bin/bash

# Replace with your mail directory (Pine uses mail, Elm and mutt use Mail)
MAILDIR=$HOME/Library/Mail/Folders

# Directory for storing procmail log and rc files
# It would be "normal" to use $HOME/.procmail for this...
PMDIR=$HOME/Library/Mail/Procmail

# And $PMDIR/log is often used here..
LOGFILE="$PMDIR/Mail log.txt"

# ---custom stuff---
# IFF your copy of procmail is built with the Maildir patch (it should be!)
# and you want to use it to put mail into ~/Maildir, uncomment the next
# line.  The trailing / is what tells Procmail to write to a maildir.
#DEFAULT=$HOME/Maildir/

# Or you can put all of your mail in mbox format, but in $HOME instead.
#DEFAULT=$HOME/mailbox

# Personally, I like all of my mail in $MAILDIR..
DEFAULT=Inbox/

# This just saves stuff to $MAILDIR/test if it has test in the subject
#INCLUDERC=$PMDIR/rc.testing

# The Mail Filtering FAQ chops .procmailrc up into pieces based on what
# sort of recipe is in the file.  Not a bad idea really..
INCLUDERC=$PMDIR/rc.spam
INCLUDERC=$PMDIR/rc.maillists
INCLUDERC=$PMDIR/rc.idiot
INCLUDERC=$PMDIR/rc.special
INCLUDERC=$PMDIR/rc.dupe


Here's my rc.maillists file:


#  Sorts the mailing lists

# SF, icculus, etc all have group-<foo> mailing lists.  Let's match on an
# entire group's lists all at once!  Note that we deliver with :0 and not
# :0: below.  Don't do that with mbox.  Maildir needs no locking.
:0
* ^Mailing-List:.*twilight-.*icculus\.org
* ^Mailing-List:.*twilight-\/[-A-Za-z0-9]*
"List:Twilight/"

# And actually, the above rule reflects a change in my mail viewing
# habits.  Originally, the rule was intended to deliver each of a group's
# lists to a seperate folder.  Note the \/ in the expression, that's
# procmail's own signal that what follows should be stored in the variable
# MATCH.  The expression that follows needs to be directory safe for what
# we're doing, so we limit what is matched to -, letters, and numbers.
# Here's how it used to work:
#:0
#* ^Mailing-List:.*twilight-.*icculus\.org
#* ^Mailing-List:.*twilight-\/[-A-Za-z0-9]*
#"List:Twilight-${MATCH}/"

:0
* ^Mailing-List:.*neither-.*icculus\.org
* ^Mailing-List:.*neither-\/[-A-Za-z0-9]*
"List:Neither/"

:0
* ^List-Id:.*eug-lug\.efn\.org
"List:eug-lug/"



Use postfix or exim?  Miss qmail's single line command to make a Maildir?
Well duh, write a script!  Here's one:

#! /bin/sh

# In the absence of real error handling...
set -e

install -m 700 -d $1
install -m 700 -d $1/tmp
install -m 700 -d $1/cur
install -m 700 -d $1/new

_______________________________________________
EuG-LUG mailing list
[EMAIL PROTECTED]
http://mailman.efn.org/cgi-bin/listinfo/eug-lug

Reply via email to