Bowie Bailey wrote:
Jay Lee wrote:
  
Bowie Bailey wrote:
    
Tommy Braun wrote:
      
Bowie Bailey wrote:
        
And then, I call spamc from maildrop like this:

   import USER
   exception {
       xfilter "/usr/bin/spamc -u $USER"
   }
          
the $USER is only available, when running maildrop from courier, is
this right? E.g. if using postfix, that $USER will not exist?

I have the impression, that it is all better and easier to setup with
courier, only thing is: only few people seem to know it ;)

Thanks for your answers, really helps me to get some light into it!
        
Yes, the USER environment variable is set by Courier.  If you are
using Postfix, you may have to poke around to find the right
variable to use.  Basically, you are just passing the delivery
email address to spamc.
      
Just one comment here, when setting this up in my environment, I
found it much easier to use MySQL based SA prefs and training rather
than file based.  It means you don't have to deal with file
permissions, etc and it's also much more scalable than flat db files
for bayes training.    
    

That may be true, but I've never attempted it that way.  If you have a
working config with Courier and MySQL, please share.  :)

  
Sure, the most relevant parts are:

my /etc/init.d/spamassassin script that starts spamd has:

SPAMDOPTIONS="-d -c -m20 -q -x"

where -d means daemonize the process, -c means create non-existant prefs for new users (not entirely sure this is necessary for SQL), -m20 means start max of 20 children (this might be zealous, I believe I bumped it awhile back when maildrop starting timing out...), -q means use SQL instead of flat files and -x means don't try to look for per-user-config in home directories.

In /etc/mail/spamassassin/local.cf I have:

#Use mysql for user prefs
user_scores_dsn                 DBI:mysql:spamassassin:localhost
user_scores_sql_username        spamassassin
user_scores_sql_password        password

#Use mysql for bayes autolearning data
bayes_store_module              Mail::SpamAssassin::BayesStore::SQL
bayes_sql_dsn                   DBI:mysql:spamassassin:localhost
bayes_sql_username              spamassassin
bayes_sql_password              password


In the global maildroprc I have:

import USER
xfilter "/usr/bin/spamc -u $USER -s 300000"

You may need to install a few perl scripts from CPAN also, follow the generic SQL info from Spamassassin's docs.



Reply via email to