[Dovecot] antispam plugin, amavis and sa-learn

Johannes Berg johannes at sipsolutions.net
Tue Jul 8 12:54:58 EEST 2008


On Tue, 2008-07-08 at 10:53 +0200, Johannes Bauer wrote:
> 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.

I have no idea. Try maybe writing a small C wrapper that checks the
arguments. Also check what user your imap is running under, normally it
would be the user who logged in unless those are virtual.

johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20080708/66250a3d/attachment.bin 


More information about the dovecot mailing list