MailScanner prevents bayes mysql autolearn

ADMX - Antal Delahaije antal at
Thu Jun 11 14:32:21 UTC 2015

Hi Jim,

That's also possible because I actually encountered this while running the sa-learn password from bash. I already added this symlink, but still I don't think changing bayesstore to SDBM was a bad move.


Regards Antal.

-----Oorspronkelijk bericht-----
Van: MailScanner [mailto:mailscanner-bounces at] Namens Jim Creason
Verzonden: donderdag 11 juni 2015 16:12
Aan: MailScanner Discussion
Onderwerp: Re: MailScanner prevents bayes mysql autolearn

Hi Antal,

This sounds like something I encountered setting this up a couple months ago.  I'm pretty sure my issue was this symlink in /etc/spamassassin was
missing: -> /etc/MailScanner/spam.assassin.prefs.conf


On 6/10/15 4:20 PM, ADMX - Antal Delahaije wrote:
> Hi,
> I’ve configurerd the latest MailScanner 4.85.2 in combination with 
> MailWatch 1.2.0 beta 8. Everything works fine except for bayes autolearning.
> If I set ‘SpamAssassin User State Dir = 
> /var/spool/MailScanner/spamassassin’ the bayes files are written into 
> this directory but it also creates a journal which always is created 
> with 0600 permissions thus MailWatch cannot access this journal until 
> I manually set permission to 0660. This journal merges with the bayes 
> database and a new file with the same 0600 permissions is created.
> Whatever I do to this folder permissions or set in MailScanner.conf, 
> it always is permission 0600.
> Then I figured out bayes can also write to MySQL database so I’ve 
> configured something like below in my spam.assassin.prefs.conf.
> bayes_store_module Mail::SpamAssassin::BayesStore::MySQL
> bayes_sql_dsn      DBI:mysql:sa_bayes:
> bayes_sql_username sauser
> bayes_sql_password password
> bayes_sql_override_username postfix
> This works great for all e-mails I manually learn with ‘sa-learn –p 
> /etc/MailScanner/spam.assassin.prefs.conf –-ham/--spam file’ command 
> or I learn from the MailWatch frontend, no more errors here!
> After a while I noticed MailScanner said it was autolearning but still 
> creating the local bayes files in ‘/var/spool/MailScanner/spamassassin’.
> I tried disabling the ‘SpamAssassin User State Dir’ but this 
> completely stopped autolearning.
> I think MailScanner is somehow preventing spamassassin to autolearn 
> via MySQL. Is this possible what I am doing via MailScanner? Maybe 
> some misconfiguration?
> Or does anybody know the solution to get autolearn working the 
> conventional way?
> Best regards,
> Antal.

Jim Creason

Chief Engineer

Shouting Ground Technologies

MailScanner mailing list
mailscanner at

More information about the MailScanner mailing list