Helpful Information
 
 
Category: Social Forum
Procmail Help Badly Needed!!

Hello, I am trying to redirect messages based on subject. Here is my code below:

:0
* ^Subject:.*(mortgage|debt|free|training|mentor)|\
/var/spool/mail/anter

For some reason the code will just not redirect. However when I do this:

:0
* ^Subject:.*(mortgage|debt|free|training|mentor)|\
!Outside-mail@slappy.com

Everything works peachy. There is something I am not seeing or am unawre of. PLEASE HELP!!!!!!

You want:

:0
* ^Subject:.*(mortgage|debt|free|training|mentor)
/var/spool/mail/anter

The trailing "|\" is telling procmail to do an "OR" with the next line so it's treating "/var/spool/mail/anter" as a rule and not a destination.

First, thank you for your reply. I copied and pasted everything exactly as you had it and still it does not redirect e-mails.

Is there some other setting I need set that I am not aware of to enable this? Below is ALL the code from my procmailrc file:


# Added By HostDir
#DON’T TOUCH!!!!
VERBOSE = “1”
LOGABSTRACT = “yes”
SHELL = “/bin/sh”
LOGFILE = “/var/log/procmail”
MAILDIR=“/var/spool/mail”


#DON’T TOUCH!!!!
#
RESIDUE = `/bin/procmail_checker $DEFAULT $LOGNAME 2>/dev/null`
:0
* ? test $RESIDUE != “unlimited”
{
:0
* > $RESIDUE
{
LOGFILE=/proc/self/fd/2
LOG=”554 - Mailbox quota exceeded by $LOGNAME

EXITCODE=69
:0
/dev/null
}
}

#OK TOUCH!!


:0
* ^Subject:.*(mortgage|debt|free|training|mentor)
/var/spool/mail/anter

I tested the rule in my own configuration and it's working.

All mail is routed through procmail by default so there is nothing to enable.

The delivery path is setup for IMAP which is different than POP so make sure that is what you want.

I am not sure how you modified the file but if you modified it on a Window PC and then uploaded the file you will need to either ssh into you account and run `dos2unix /etc/procmailrc` or use a text editor that uses the correct line feeds.

You can also look at the log in /var/log/procmail to see if there are any errors.










privacy (GDPR)