[plug] Procmail filtering with Debian Sarge + Dovecot

Michael Hunt michael at aussie.oddsocks.net
Tue Mar 15 15:36:33 WST 2005


Hiya all,

I decided today that since I had some spare time I would try and
implement server side mail filtering using procmail on my debian box.
Having searched the web I have come to the conclusion that it is a
fairly easy two step approach of (1) forwarding the mail to procmail (in
my case using the users .forward file) and (2) writing recipes to filter
the mail in the users .procmailrc file.

At this stage I have two questions relating to the above files. My first
is with regards to the entry I put in the .forward file. From what I
have read the following line should work :-

|/usr/bin/procmail

while on another site it suggested :-

"|IFS=' ' && exec /usr/bin/procmail || exit 75 #myid"

Can anyone tell me what the difference is and why such a line might be
better than the first?

My second question relates to the procmailrc file. I have included it
below so that someone here might be able to double check its validity,
but my particular question relates to my uncertainty over the formatting
of the folder line in the Plug recipe. I am using Dovecot as the IMAP
server running maildir style mailboxes. Can someone confirm that the
format is correct for dovecot and if there will be a problem with the
white spaces in one of the folders name? If so, is there a way around
the white spaces issue without having to rename the folder?

<Copy of .procmailrc file>

# My .procmailrc
# Used to routes incoming mail to appropriate folders.

# Basic config/setup

SHELL=/bin/sh
PATH=/usr/bin:/usr/local/bin
MAILDIR=$HOME/Maildir   	# Location of my mail folders
DEFAULT=$HOME/Maildir		
# Default location (override /var/mail/<user>)
PMDIR=$HOME/.procmail		
# Directory for storing procmail configuration and log files
LOGFILE=$PMDIR/pmlog
	
# Put mail from PLUG Linux mailing list into folder PLUG
:0:
* ^List-Id:.*plug.org.au
.My Mail Folders.Linux.PLUG/
# Above line is the one my question is about

# Put the rest of my mail in my inbox
:0:
${DEFAULT}

THanks in advance to anyone who can help me with this.

To everyone else I hope your Tuesday has been going well.

Michael Hunt




More information about the plug mailing list