per_user prefs not working ?

Michael Baird mike at TC3NET.COM
Mon Dec 8 15:15:52 GMT 2003


MailScanner won't use per user spamassassin preferences, it uses the
prefs file specified in MailScanner.conf for all users or
/root/.spamassassin, since MailScanner runs as root. I faced this issue
myself when I migrated my spam scanning to MailScanner, my solution was
to create a procmail ruleset, which duplicates all my users individual
spamassassin user_prefs behaviors (hit threshold, spam tag, whitelist,
blacklist). I just have MailScanner check the spamlevel and such. I'll
post the recipe here (I'm still working on making the
whitelist/blacklist work better). Scanning all messages through
MailScanner and filtering via a procmail ruleset, has lowered my load
averages tremendously, as opposed to calling spamc via a procmail
ruleset.


INCLUDERC=$HOME/.procmail/.spamprefs
WHITELIST=$HOME/.procmail/.whitelist
BLACKLIST=$HOME/.procmail/.blacklist

:0
* < 20000
{
        :0
        * ?egrep --silent --file $WHITELIST
        $DEFAULT
        :0
        * ?egrep --silent --file $BLACKLIST
        /dev/null
        :0
        *$ ^X-TC3Net-Level: $SPAMLEVEL
        {
                :0
                * ^Subject:[    ]*\/[^  ].*
                {
                        SUBJECT=$MATCH
                }
                :0 fw
                | formail -I "Subject: $SPAMTAG $SUBJECT"
                :0
                $SPAMBOX
        }
}

Where .whitelist and .blacklist are just list of email addresses, and
.spamprefs contains a few variable definitions used in the recipe.

SPAMLEVEL=xxxxxxxxxx
SPAMTAG=*****SPAM*****
SPAMBOX=.maildir/

Regards
MIKE

> Hi
>
> I am trying to get the per_user preferences working
>
> I set SpamAssassin User State Dir = ~/.spamassassin/
> in /etc/MailScanner.conf
>
> I then created a  .spamassassin directory in my home dir
>
> I then create a file user_prefs in this directory
>
> inside the user_prefs file i put  required_hits  10
>
> i then chown and chmod accordingly
>
> Restart MailScanner and send a test spam.
>
> The headers still tell me it is working on a required hits of 5
>
> What am i doing wrong?
>
> Regards
>
> Stuart Clark RHCE
> Spacelink Communications Pty Ltd
>



More information about the MailScanner mailing list