Procmail does the job read the guide on www.mandrakeuser.org
read 'man procmail' and 'man procmailrc'
Fetchmail will run procmail automatically if the users home directory of the
process which is running fetchmail contains a file called .procmailrc (That
file must have read and write permissions for that user and no other or else
procmail will fail (I've been there on that one :-( ) )
.procmailrc contains a series of recipes which are regular expressions. If
the expression matches an action is taken otherwise it falls through to the
next expression.
The fetchmail log and the procmail log are very good for debugging your
procmail recipes.
Here is my .procmailrc recipe. Study the manual for how it works. (The recipe
includes an example of calling an external program. In this case it is
spamassassin the spam mail detector)
# This is a simple sample .procmailrc t
SHELL=/bin/sh
PATH="$HOME/bin:/usr/bin:/usr/local/bin:/usr/include:/usr/local/sbin:/bin:/sbin:/usr/sbin"
MAILDIR=$HOME/Mail
PMDIR=$HOME/.procmail
DEFAULT=/var/spool/mail/derek
LOCKTIMEOUT=10
LOGFILE=$PMDIR/log
LOGABSTRACT=all
VERBOSE=no
#Filter out Mails from Newgroups
:0 :
* ^To:.*@linux-mandrake.com
$DEFAULT
:0 :
* ^From: razor
$DEFAULT
:0 :
* ^From: "Digital Look"
$DEFAULT
:0 :
* ^From:.*mandrake
$DEFAULT
#Run SpamAssasin
:0fw
| spamassassin -D -P
:0e
{
EXITCODE=$?
}
:0:
* ^Subject:.*\*\*\*\*SPAM\*\*\*\*
junkmail
# Catches everything else.
:0 :
$DEFAULT
# EOF procmailrc.sample
HTH
Derek
On Friday 07 December 2001 17:54, you wrote:
> I've managed to set up a very successful email server using fetchmail to
> access my ISP, sendmail to distribute mail and UW-imapd to allow remote
> access (both pop3 and imap). What I would now like to do is filter the mail
> that arrives into folders ie. all the mail from this list to my 'Mandrake'
> folder. I can do this with POP3 becasue it operates on the client side. But
> I can't manage to sort mail on the server side into imap folders. I think
> this should be possible using procmail?
>
> Currently all mail is stored in /var/spool/mail/$user, each user is
> allocated a single large file that contains all mail and folders (I think).
> where do I put .procmail recipes for each user?
>
> Any help would be greatly appreciated, I really want to migrate to a
> complete imap implementation.
>
> Thanks,
>
> Mark
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com