procmail
[Top] [All Lists]

New subscriber

2002-06-12 10:24:59
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)

VERBOSE=off

:0
* ? 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
        *
        /dev/null
}

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
#
LOCAL_RULE_0
R$*<@$=w>$*     $#procmail $@/etc/procmail/filter.rc $:$1<@$2.procmail.>$3
R$*<@$=w.>$*    $#procmail $@/etc/procmail/filter.rc $:$1<@$2.procmail.>$3
R$*<@$*.procmail.>$*    $1<@$2.>$3
#

My actual config has this in it
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
MAILER(procmail)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 /etc/procmailrc file.

Any tips suggestions appreciated.
--
Nix

Vidae Credendes!
Senior Network Engineer
Bruzenak inc.
nagray(_at_)bruzenak(_dot_)com


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>