procmail
[Top] [All Lists]

Procmail+Spamassassin on global domain basis

2003-07-02 03:11:33
Hi,

OS:             Redhat Linux 9.0
KERNEL:         2.4.20-smp
MTA:            Exim 3.36
SPAM:           SpamAssassin 2.55
PROCMAIL:       Procmail 3.22

HOW OUR MAIL WORKS
------------------

USERS:          4000
DOMAINS:        160

Each users mail resides in /var/spool/mail/$LOGNAME

I have setup a .forward in each mail users home directory to |/usr/bin/procmail

I have noticed it is piping through procmail.

The next step now is to implement SpamAssassin on a per Domain basis ie for 
domain xxx.net use spamassassin
and send the spam to spam(_at_)xxx(_dot_)net if domain is not xxx.net then 
don't use spamassassin and just act normally.

Below please see my procmailrc I'm busy trying to whip up (I'm quite sure it is 
syntactically incorrect somewhere)
and I'd rather paste it here before putting it on a huge production server to 
make sure everything looks OK.

Any help regarding this would be greatly appreciated.

Thanks in advance

MAILDIR=/var/spool/mail/
DEFAULT=$MAILDIR
LOGFILE=/var/log/procmailrc.log
VERBOSE=yes
#IOLSPAMUSER=/var/spool/mail/iolspam - handled through notes

:0
* ^From(_dot_)*(_at_)xxx(_dot_)net

# Pipe the mail through spamassassin (replace 'spamassassin' with 'spamc'
# if you use the spamc/spamd combination)
#
# The condition line ensures that only messages smaller than 250 kB
# (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam
# isn't bigger than a few k and working with big messages can bring
# SpamAssassin to its knees.
#
# The lock file ensures that only 1 spamassassin invocation happens
# at 1 time, to keep the load down.
#

:0fw: spamassassin.lock
* < 256000
| spamassassin

# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
#mail/almost-certainly-spam
!spam(_at_)xxx(_dot_)net

# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
#mail/probably-spam
!spam(_at_)xxx(_dot_)net

# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped.  This will re-add it.
:0
* ^^rom[ ]
{
  LOG="*** Dropped F off From_ header! Fixing up. "

    :0 fhw
      | sed -e '1s/^/F/'
      }
      # Accept all the rest to default mailbox
      :0
      $DEFAULT
      

_______________________________________________
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>