[Dovecot] antispam plugin, amavis and sa-learn

Johannes Bauer jb at 5pm.de
Tue Jul 8 11:53:32 EEST 2008


Hello,

I would like to use the Dovecot antispam plugin to train SpamAssassin via
sa-learn. I compiled the plugin and got it to work with the sendmail
backend, which I tested by having it send a message to me.

As I'm calling SpamAssassin with amavisd-new, I have a system-wide Bayes
db, maintained by the amavis user. As expected, the antispam plugin calls
the configured binary as the mail user (I'm running deliver as suid, with
mixed virtual and system accounts).

My question is: How can I get the plugin to call sa-learn as user amavis?

I have tried the following things:
(1) making the amavis user's .spamassassin directory to world-writeable
and handing the path to sa-learn with the --dbpath parameter. That failed
- the IMAP client says "Move not allowed" when I try to move a message to
or from the Spam IMAP folder.

(2) making a suid copy of sa-learn with owner amavis. This failed because
of an sperl error.

(3) editing sudoers to allow 'sudo -u amavis sa-learn' without a password.
This works fine on the command line, but fails with the same error as (1)
when used with the plugin.

Although I compiled the plugin from git with debugging to syslog
activated, I do not get any error messages in mail.log where all messages
from dovecot are logged.

Now, I know that the methods above aren't exactly secure, so if anybody
has a different way of training SpamAssassin with the antispam plugin in a
amavis setup, I would appreciate it.

Thank you,
Johannes



More information about the dovecot mailing list