kopano-spamd won't learn any spam
I’ve setup kopano-spamd on Ubuntu 16.04. I had it already working properly but I think after moving my installation to another disk with rsync my spam-db was lost or something else went wrong.
If I drag a spam mail to the spam folder, I always get:
2017-03-21 15:44:06,079 - spamd - INFO - [gerrit] sa-learn: Learned tokens from 0 message(s) (1 message(s) examined)
in the spamd.log
spamassasin debug log shows:
For debugging I’ve set the permissions of /home/gerrit/.spamassasin to 777 and still it won’t learn anything. The example spam-mail even shows a score above 5, it was an old mail I found in my inbox. I don’t see any reason why it doesn’t work anymore.
Any help is appreciated
Ok, I’ve found the reason. The script creates a folder in /tmp on start called tmp(something) with rwx permissions only for the user kopano , but sa-learn is called with the user amavis. After running the script from commandline I got the following output:
suconfig: path "/tmp/tmpgQePIs/.spamassassin" is inaccessible: Permission denied config: path "/tmp/tmpgQePIs/.spamassassin/user_prefs" is inaccessible: Permission denied do config: path "/tmp/tmpgQePIs/.spamassassin" is inaccessible: Permission denied config: path "/tmp/tmpgQePIs/.spamassassin" is inaccessible: Permission denied bayes: expire_old_tokens: locker: safe_lock: cannot create lockfile /tmp/tmpgQePIs/.spamassassin/bayes.mutex: Permission denied plugin: eval failed: bayes: (in learn) locker: safe_lock: cannot create lockfile /tmp/tmpgQePIs/.spamassassin/bayes.mutex: Permission denied ERROR: the Bayes learn function returned an error, please re-run with -D for more information at /usr/bin/sa-learn line 501.
If I do a chmod 777 on that folder everything works fine. Does anybody have an idea how to change that permissions the script sets? If anybody is wondering, I’m talking about this script https://kb.kopano.io/display/WIKI/Kopano-spamd
I followed this
as described here
and that works for me
@externa1 I have this line, too. The issue is still that the user kopano creates a folder which the user amavis can not access. Do you use mysql or files for spamassassin? This user also reports that it only works with mysql. I think it could be the same issue.