1

I am running spamassassin on Ubuntu 14.04 as root. When I am calling any of the methods, such as Check or ReportSpam, I am also passing in another user that the check should be run as. However I get a permissions issue

spamd: Can't locate Mail/SpamAssassin/PerMsgLearner.pm: Permission denied at /usr/share/perl5/Mail/SpamAssassin.pm line 644, line 7.

Looking at line 644 in that perl script it tries to import another perl file

require Mail::SpamAssassin::PerMsgLearner;

This is not an issue executing as root. The problem with executing the functions as root is that the bayes files (for learning over time about spam) get written to /nonexistent, a dir that doesn't exist (it is home dir for 'nobody' user).

So either as root or another user I cannot get SpamAssassin to write bayes file to disk so the learning functionality is broken.

1

Turns out I had to add the following line to the /etc/mail/spamassassin config and then re-compile spamassassin. Note, it is important to include file name at the end e.g. bayes

bayes_path /path/to/dir/bayes

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.