On Thu, 2007-11-01 at 10:44 -0600, Mark Farver wrote:
> Someone mentioned here a few days ago that there was a way to have SA do 
> per user configs based on the To: field (or Rcpt to?).  I can't figure 
> out how that would be done.  Anyone have any hints or pointers to where 
> it is mentioned in the docs?

According to the 'spamd' man-page, the --virtual-config-dir option
causes file user_prefs under the directory in question to be used
for the user whose email address resolves to the virtual dir in
question.  There is an example in the man page:
        --virtual-config-dir=/vhome/users/%u/spamassassin
To: [EMAIL PROTECTED] is resolved as:
        /vhome/users/[EMAIL PROTECTED]/spamassassin
so spam-assassin will read the file
        /vhome/users/[EMAIL PROTECTED]/spamassassin/user_prefs

It is the 'spamc' program which sets the user name.  The behaviour you
describe should be disabled by setting '-x'.

>From the 'spamc' man-page:

        Spamc is the client half of the spamc/spamd pair.  It should be
        used in place of "spamassassin" in scripts to process mail.  It
        will read the mail from STDIN, and spool it to its connection to
        spamd, then read the result back and print it to STDOUT.  Spamc
        has extremely low overhead in loading, so it should be much
        faster to load than the whole spamassassin program.

The spamassassin plugin talks directly to spamd via:

        print SPAMD "SYMBOLS SPAMC/1.3" . CRLF;
        print SPAMD "User: $username" . CRLF;

So the problem may be that $username is not being set from the To:
field, yep that seems to be it:

        my $username = getpwuid($>);

This may take some rewriting of the spamassassin plugin since it needs
to know how 'spamd' was called.

I am just starting on configuring my mail system with the 0.33-dev
branch.  I will try to remember to get back to this, as this is a change
I will need.

> 
> The closest thing I can find in the docs is spamd's -x and  
> --virtual-config-dir options, but using those I just get configurations 
> for one user: smtpd which is the user qpsmtpd is running as.
> 
> Thanks
> Mark Farver

-- 
--gh


Reply via email to