Re: [Mimedefang] Cannot get spamassassin to use bayes
Date: Tue, 17 Oct 2006 15:37:40 +0200 From: Andrea Venturoli [EMAIL PROTECTED] Reply-To: mimedefang@lists.roaringpenguin.com As per subject, I'm running the most recent stable versions of sendmail+mimedefang+spamassassin on FreeBSD 5.4. Due to the latest overwhelming increase in spam getting in I tryed enabling bayesian filters: I trained spamassassin and manually checked that it works quite effectively; however I cannot get it to apply bayes when called from mimedefang. I've put: use_bayes 1 bayes_path /usr/local/etc/mail/spamassassin in /usr/local/etc/mimedefang/sa-mimedefang.cf. This will cause you to have one Bayesian database for all users. Bayesian testing works best when done for each user individually. In order to do this, you may want to store the bayes stuff in an SQL database. However, I have to warn you that this can seriously bloat MySQL databases. Mine are currently running at just under 4 GB and 99% of that is attributable to using it to store SpamAssassin bayes stuff. Having gotten the warning out of the way... You will need to be using stream_by_recipient() to be able to process each user individually. Also you will need $SASpamTester-signal_user_changed({ username = $user }); prior to the call to spam_assassin_check(); In order to get the $SASpamTester variable iniitialised, you will need this code in your filter (it used to be in the sample filter, but has since been removed): # The next lines force SpamAssassin modules to be loaded and rules # to be compiled immediately. This may improve performance on busy # mail servers. Comment the lines out if you don't like them. if ($Features{SpamAssassin}) { spam_assassin_init()-compile_now(1) if defined(spam_assassin_init()); } You will also need to add some lines to your /etc/mail/sa-mimedefang.cf file: bayes_store_module Mail::SpamAssassin::BayesStore::MySQL bayes_sql_dsn DBI:mysql:spamassassin:localhost bayes_sql_username spamuser bayes_sql_password XXX bayes_auto_learn_threshold_nonspam 0.4 bayes_auto_learn_threshold_spam 10.0 bayes_ignore_to users@spamassassin.apache.org You will need to setup a bunch of tables as well. See the README files in the sql directory of the SpamAssassin distribution on how to setup the database tables. ___ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
Re: [Mimedefang] Cannot get spamassassin to use bayes
Oliver Schulze L. wrote: Hi, then the user mailnull must have access to that file, try this: su mailnull -c touch /usr/etc/mail/spamassassin_test1 I had to give mailnull a shell, then i did su mailnull -c 'touch /usr/local/etc/mail/spamassassin_test1' and it worked. The problem is that with that bayes_path option, SA will create these files: /usr/local/etc/mail/spamassassin_journal /usr/local/etc/mail/spamassassin_seen /usr/local/etc/mail/spamassassin_toks Still, I don't see these :-( bye Thanks av. ___ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
Re: [Mimedefang] Cannot get spamassassin to use bayes
Hi, then the user mailnull must have access to that file, try this: su mailnull -c touch /usr/etc/mail/spamassassin_test1 The problem is that with that bayes_path option, SA will create these files: /usr/local/etc/mail/spamassassin_journal /usr/local/etc/mail/spamassassin_seen /usr/local/etc/mail/spamassassin_toks If you want to create inside a directory, use this option: bayes_path /usr/etc/mail/spamassassin/bayes Then, mkdir -p /usr/etc/mail/spamassassin/ and su mailnull -c touch /usr/etc/mail/spamassassin/bayes_test1 and you will end up having these files: /usr/local/etc/mail/spamassassin/bayes_journal /usr/local/etc/mail/spamassassin/bayes_seen /usr/local/etc/mail/spamassassin/bayes_toks HTH Oliver Andrea Venturoli wrote: There is no defang user on my system; on FreeBSD mimedefang runs as user mailnull. I've got no /usr/etc/mail/spamassassin_* files; maybe you meant /usr/local/etc/mail/spamassassin/*? Permissions were good for user mailnull, but now I modified /usr/local/etc/mail recursively to be readable and writeable by everyone; still I don't get bayes working. bye Thanks av. -- Oliver Schulze L. Get my e-mail after a captcha test in: http://tinymailto.com/oliver ___ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
Re: [Mimedefang] Cannot get spamassassin to use bayes
Oliver Schulze L. wrote: Check that the user defang can reach and write to /usr/local/etc/mail/spamassassin_* files There is no defang user on my system; on FreeBSD mimedefang runs as user mailnull. I've got no /usr/etc/mail/spamassassin_* files; maybe you meant /usr/local/etc/mail/spamassassin/*? Permissions were good for user mailnull, but now I modified /usr/local/etc/mail recursively to be readable and writeable by everyone; still I don't get bayes working. bye Thanks av. ___ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
Re: [Mimedefang] Cannot get spamassassin to use bayes
Check that the user defang can reach and write to /usr/local/etc/mail/spamassassin_* files HTH Oliver Andrea Venturoli wrote: use_bayes 1 bayes_path /usr/local/etc/mail/spamassassin -- Oliver Schulze L. Get my e-mail after a captcha test in: http://tinymailto.com/oliver ___ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com http://lists.roaringpenguin.com/mailman/listinfo/mimedefang