On Sun, Aug 19, 2007 at 07:23:19PM +1000, Chris wrote:
Is there any way to fetch the mails in /home/user/Mail/username? I
also use procmail to filter mails.
Here is my ~/.procmailrc It should do what you want. Note that there is some
other stuff going on (virus / spam filtering) and the main processing into
folders takes place in a separate file called rc.mlists.
I have left many of the original comments in the file but note that I have
overridden the final section that says Messages that fall through... to read
/home/user/Msgs (my user Mail directory).
HTH
Mark
Begin Variables section
# It is essential that you set SHELL to a Bourne-type shell if
# external commands are run from your procmailrc, for example if
# you use rc.spamassassin, rc.quarantine, or other advanced recipes.
# Setting SHELL should not be needed for the simple sorting recipes in
# this step-by-step section, but to be safe and to future proof your
# procmailrc, set it anyway! Details are in Check Your $SHELL and $PATH.
SHELL=/bin/bash
# Directory for storing procmail configuration and log files
# You can name this variable anything you like, for example
# PROCMAILDIR, or don't set it (but then don't refer to it!)
PMDIR=$HOME/Procmail
# LOGFILE should be specified ASAP so everything below it is logged
# Put ## before LOGFILE if you want no logging (not recommended)
LOGFILE=$PMDIR/pmlog
# To insert a blank line between each message's log entry,
# uncomment the next two lines (this is helpful for debugging)
## LOG=
##
# Set VERBOSE to yes when debugging; VERBOSE default is no
## VERBOSE=yes
# Replace $HOME/Msgs with the directory where your personal (non-system-spool)
mailboxes reside
# Mailboxes in maildir format or served by Courier IMAP are often in
$HOME/Maildir
# Mailboxes served by UW IMAP are sometimes in $HOME, sometimes in $HOME/mail,
sometimes elsewhere
MAILDIR=$HOME/Msgs
# IMPORTANT:
# * On most systems your $MAILDIR directory is a subdirectory of $HOME
# * Upon reading a line that contains MAILDIR=
# Procmail does a chdir to $MAILDIR
# ...and $MAILDIR becomes the Procmail working directory
# ...and relative paths are relative to $MAILDIR
# * Do not include a trailing slash in your MAILDIR setting
# * The $MAILDIR directory must exist and be writable by your LOGNAME
# * The MAILDIR variable is an entirely different entity from maildir mailbox
format
End Variables section; Begin Processing section
## This section redirects mail to Clamav for virus checking
:0fw
| /usr/local/bin/clamassassin
:0:
* ^X-Virus-Status: Yes
IN-virus
#
# spam filter
#
:0fw: spamassassin.lock
* 256000
| /usr/bin/spamc
#
# spam folder for email identified as spam - change file/directory name
# if necessary
#
:0:
* ^X-Spam-Status: Yes
IN-Spam
#
# end of spam filter
#
## This section filters the mail into folders according to rules in rc.mlists
##INCLUDERC=$PMDIR/rc.testing
INCLUDERC=$PMDIR/rc.mlists
# Messages that fall through all your procmail recipes are delivered
# to your default INBOX. To find out yours, see step 1 above.
:0:
* ^TO_*
/home/user/Msgs
End Processing section
# EOF
pgpUF7v9zHggX.pgp
Description: PGP signature