Total newbie to procmail. Despite the fact it has been on my Linux boxes
for awhile, I never did anything with it before.
Don't laugh at my first script. (It took me several hours to get this straight)
* ? formail -x"From" | egrep -is -f RejectFrom #Match mail that comes
from values in RejectFrom file
DATE=`date +%Y%m%d%H%M%S` # Date in Zulu format
REASON=`formail -c -xFrom:` # Since we are looking at "From"
show why it failed
SPAMLOG=/var/log/procmail/rejected-mail # Log to be emailed and
cleaned once a day using the Linux util
:0 #Make the log entry
|echo "$DATE:Rule RejectFrom:Reason$REASON" >> $SPAMLOG;
:0 #Toss the message
I wanted something I could mail at the end of the day and let me know how
my rules were working.
This is a fantastic program, I wish I would have seen it earlier. I do have
a question though. I am a little unclear as to what need in my sendmail.mc
file to make sure that all traffic is being filtered.
One set of instructions indicates this
R$*<@$=w>$* $#procmail $@/etc/procmail/filter.rc $:$1<@$2.procmail.>$3
R$*<@$=w.>$* $#procmail $@/etc/procmail/filter.rc $:$1<@$2.procmail.>$3
My actual config has this in it
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
I am thinking that the stuff that is in the config file causes procmail to
be the LDA . Doesn't this also cause all mail going through the MTA
(Sendmail) to be filtered. Therefore I don't need the LOCAL_RULE_0.
Also since procmail is using the /etc/promailrc file. I am thinking the
best thing to do is create an /etc/procmail direcotry and create all of my
recipes in there with the .rc extension and include them into the
Any tips suggestions appreciated.
Senior Network Engineer
procmail mailing list