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.