Spamassassin: sa-learn fails in cronjob

Bug #1315260 reported by Daniel Eiteneuer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
spamassassin (Ubuntu)
Incomplete
Medium
Unassigned

Bug Description

Running
su amavis -c '/usr/bin/sa-learn -D --ham /tmp/learn_mail'
in a cronjob leads to the output being sent via mail (see text file). Spamassassin complains about a problem on loading plug-ins such like:
plugin: failed to parse plugin (from @INC): Can't locate Mail/SpamAssassin/Plugin/SpamCop.pm: Keine Berechtigung at (eval 33) line 1.
Note: "Keine Berechtigung" is German and means something like no authorization. But the perl file exists and everyone can read it:
-rw-r--r-- 1 root root 8578 Feb 7 09:36 /usr/share/perl5/Mail/SpamAssassin/Plugin/SpamCop.pm
The same for all other plug-ins.
Running the command as mentioned above manually from the shell as user root works perfectly, no errors.
I'm using spamassassin version 3.4.0-1ubuntu1 and perl version 5.18.2-2ubuntu1 on Ubuntu 14.04.

Maybe there is relation to:
https://bugzilla.redhat.com/show_bug.cgi?id=1008415
?? Don't know.

Regards
Nuesel

Revision history for this message
Daniel Eiteneuer (nuesel) wrote :
Robie Basak (racb)
Changed in spamassassin (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Daniel Eiteneuer (nuesel) wrote :

In the meantime, I've got several e-mails indicating problems during some cron jobs:

mail subject: Cron <amavis@gruenbaer> test -e /usr/sbin/amavisd-new-cronjob && /usr/sbin/amavisd-new-cronjob sa-sync
refcnt: fd -1 < 0

mail subject: Cron <amavis@gruenbaer> test -e /usr/sbin/amavisd-new-cronjob && /usr/sbin/amavisd-new-cronjob sa-sync
rules: failed to run header tests, skipping some: __alarm__ignore__(39/::Plugin::Check::run_eval_tests/1097)

mail subject: Cron <amavis@gruenbaer> test -e /usr/sbin/amavisd-new-cronjob && /usr/sbin/amavisd-new-cronjob sa-sync
rules: failed to compile Mail::SpamAssassin::Plugin::Check::_body_tests_0_1, skipping:
 (__alarm__ignore__(1/::PerMsgStatus::check/1414))

I would be happy, if someone can give someone can give me a hint, why amavis fails in cron jobs?
I upgraded the system from an Ubuntu 12.04 installation. Maybe this has something to do with the problem?

Regards
Nuesel

Revision history for this message
Bryce Harrington (bryce) wrote :

From the upstream bug report, https://bugzilla.redhat.com/show_bug.cgi?id=1008415, the finding is that the permission denied error stems from the cronjob running sa-learn from the /root directory, which the cronjob's process doesn't have access to.

Does this issue still occur with a newer version of Ubuntu?

Changed in spamassassin (Ubuntu):
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.