Koozali.org: home of the SME Server

Mail Filter (Procmail?)

Nick

Mail Filter (Procmail?)
« on: July 11, 2001, 05:40:55 PM »
Hello all.

I've been looking through previous posts to this board about filtering mail into several different folders on an IMAP account. However when I attempt to use procmail to direct mail to the various folders I have setup using the Webmail Interface the messages all get corrupted. Well maybe not corrupted but they are in a format that the Webmail does not understand?? (Filename I mean).

I've altered my ~/.qmail file to point to |procmail ~/.procmailrc instead of ~/Maildir or what have you.

Has anyone successfully implemented this sought of thing??

Thanks in advance.

Nick.

stephen@dungog.net

Re: Mail Filter (Procmail?)
« Reply #1 on: July 11, 2001, 06:04:37 PM »
i use it, but it's a bitch to configure
here is a sample
you can have forwarding as well via the c switch

1. edit .qmail as you have
2. create the folders, i use imp
3. create /home/e-smith/file/users/yourname/.procmailrc

# SET VARIABLES
# Internal Variables
SHELL=/bin/sh                   #Shell used to run procmail.
PATH=$HOME/bin:/bin:/usr/bin:/usr/local/bin
VERBOSE=on                     #Change this to "on" when you try a new recipe
                                #so that Procmail will log literally every step
                                #it takes.  DO NOT LEAVE IT ON, though, because
                                #it creates huge logfiles.

LOGFILE=/dev/null
#LOGFILE=$HOME/log        #Logs message disposition.  Recommended -- otherwise
                                  #errors are emailed to you. :/

# Default Program & file locations
DEFAULT=$HOME/Maildir/
MAILDIR=$HOME/Mail
FORMAIL=/usr/bin/formail
DAVE=$MAILDIR/daveworld/

# BEGIN RECIPES
# Nuke duplicate messages
:0 Wh: .msgid.lock
| $FORMAIL -D 16384 msgid.cache

:0
* ^To:.*cathie
! cathie@elsewhere.net

:0 c
* ^Subject:.*daveworld
! cathie@elsewhere.net

:0:
* ^Subject:.*daveworld
$DAVE

:0:
$DEFAULT

stephen@dungog.net

Re: Mail Filter (Procmail?)
« Reply #2 on: July 11, 2001, 06:04:59 PM »
i use it, but it's a bitch to configure
here is a sample
you can have forwarding as well via the c switch

1. edit .qmail as you have
2. create the folders, i use imp
3. create /home/e-smith/file/users/yourname/.procmailrc

# SET VARIABLES
# Internal Variables
SHELL=/bin/sh                   #Shell used to run procmail.
PATH=$HOME/bin:/bin:/usr/bin:/usr/local/bin
VERBOSE=on                     #Change this to "on" when you try a new recipe
                                #so that Procmail will log literally every step
                                #it takes.  DO NOT LEAVE IT ON, though, because
                                #it creates huge logfiles.

LOGFILE=/dev/null
#LOGFILE=$HOME/log        #Logs message disposition.  Recommended -- otherwise
                                  #errors are emailed to you. :/

# Default Program & file locations
DEFAULT=$HOME/Maildir/
MAILDIR=$HOME/Mail
FORMAIL=/usr/bin/formail
DAVE=$MAILDIR/daveworld/

# BEGIN RECIPES
# Nuke duplicate messages
:0 Wh: .msgid.lock
| $FORMAIL -D 16384 msgid.cache

:0
* ^To:.*cathie
! cathie@elsewhere.net

:0 c
* ^Subject:.*daveworld
! cathie@elsewhere.net

:0:
* ^Subject:.*daveworld
$DAVE

:0:
$DEFAULT

Nick

Re: Mail Filter (Procmail?)
« Reply #3 on: July 16, 2001, 05:02:39 PM »
Thanks for that. However I am still unable to successfully forward emails to certain folders, created with IMP. They appear to be either a different format or corrupted because when I try to access them with Outlook it crashes and IMP gives me a PHP error?

Emails are forwarded to the Default location alright though? Any ideas??

Thanks in advance.stephen@dungog.net wrote: