[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: procmail rule to filter debian-user



> > I need a rule to filter debian-user into a seperate maildir. I know  
> > there's the header:
> > X-Maling-List: <debian-user...

:0
*^List-Id:*lists.debian.org
/home/bijan/Maildir/.lists.debian/

should do it. 

If you set some variables at the top of your .procmailrc you can easily avoid writing out the full path of the Maildir in each recipe; for example:

PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
SHELL=/bin/bash
MAILDIR=/home/bijan/Maildir/
DEFAULT=$MAILDIR/inbox/

You may have done that already, but just in case you had not. It can help when writing the recipes. 

So, with that in mind, the following should work equally as well:

:0
*^List-Id:*lists.debian.org
.lists.debian/

The lack of the second colon at the start of the recipe is important when using Maildir format - it prevents the locking feature of procmail which is generally used for mbox format. Also, as others have pointed, don't miss the trailing slash which tells procmail to create the mailbox in Maildir format.

But, as recipes go these are really basic. Procmail is complex so it's worth spending some time reading up on it. 

HTH, 

Jamie


Reply to: