procmail
[Top] [All Lists]

Attempting to use procmail as a general filter in sendmail.cf

2000-05-04 13:27:42
Hello, not sure if this is a procmail problem or a sendmail one, but I'm 
trying to set up a sendmail.cf file on a department mail server
that will have a rule that calls procmail to run a filter in in/out bound
mail.  I'm generally trying to reduce SPAM by looking at the subject lines
and if they match the filter, toss the message into a file for scanning
later.

I guess I'm checking to see if setting up a rule is a good approach.  I'd
rather not replace the local mailer with procmail (that just sounds like 
to major of an operation), but I didn't know if I was on the right track 
or not...

Thanks,
Tom leach
leach(_at_)oce(_dot_)orst(_dot_)edu

Here's what I've tried so far:
This setup seems to work on a test system, but I wanted some assurances
before dropping it on the main mail server...
Solaris 2.6, sendmail 8.9.3, procmail 3.14

in sendmail.cf, first line of rule 0:
R$*                     $: $>99 $1              do procmail checks

in sendmail.cf, created rule 99:
###################################################################
###  Ruleset 99 -- procmail part of ruleset zero (can be null)  ###
###################################################################

S99
R$*.procmail$*         $@ $1$2         # procmail has already looked at this.
R$*<@$+>$*             $#procmail $@/etc/mail/procmail.rc $:$1(_at_)$2procmail

in sendmail.cf, procmail defination, from MAILER(`procmail`) in m4 file:
######################*****##############
###   PROCMAIL Mailer specification   ###
##################*****##################

#####  @(#)procmail.m4  8.11 (Berkeley) 5/19/1998  #####

Mprocmail,      P=/usr/local/bin/procmail, F=DFMSPhnu9, S=11/31, R=21/31, 
                T=DNS/RFC822/X-Unix,
                A=procmail -Y -m $h $f $u

------------ end of /etc/mail/sendmail.cf ---------------

In /etc/mail/procmail.rc:
:0
* ^Subject: Make Money Fast
/var/log/SPAM

:0
! -oi -f "$@"

------------ end of /etc/mail/procmail.rc ---------------

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