[Dovecot] Trouble implementing Antispam plug-in for Dovecot

Ben Johnson ben at indietorrent.org
Thu Sep 6 01:20:57 EEST 2012


Hello,

I am attempting to use the Antispam plug-in for Dovecot and am having
trouble with the implementation.

My configuration is Dovecot (1.2.9) + Sieve + SpamAssassin on Ubuntu
10.04. Mail that SpamAssassin tags as SPAM is moved into the affected
user's "Junk" folder (/var/vmail/example.com/user/Maildir/.Junk).

I followed the Wiki article at http://wiki2.dovecot.org/Plugins/Antispam
. After restarting Dovecot, my IMAP client (Thunderbird v15) reports the
following whenever I attempt to move mail from Inbox to "Junk" directory:

"[CANNOT] antispam plugin not configured"

That exact phrase appears only once in a Google search (
http://dovecot-antispam.sourcearchive.com/documentation/1.1plus-p20090218.git.g28075fa/mailtrain_8c-source.html
):

if (!hamaddr || !spamaddr) {
  mail_storage_set_error(t->box->storage,
    ME(NOTPOSSIBLE)
    "antispam plugin not configured");
  return -1;
}

Based on the surrounding source code, which I realize may be old, it
seems that Ham and Spam addresses are required, or similar.

I am using the following configuration options:

/etc/dovecot/dovecot.conf
--------------------
## IMAP specific settings
protocol imap {
  mail_executable = /usr/lib/dovecot/rawlog /usr/lib/dovecot/imap
  mail_plugins = quota imap_quota antispam
}

# [...]

plugin {
  antispam_debug_target = syslog
  antispam_verbose_debug = 1
  antispam_backend = pipe
  antispam_pipe_program = /usr/bin/sa-learn-pipe.sh
  antispam_pipe_program_spam_arg = --spam
  antispam_pipe_program_notspam_arg = --ham
  antispam_spam_pattern_ignorecase = spam;junk
}
--------------------

For what it's worth, the logging directives seem not to have any effect
(and perhaps the rest of the directives do not, either, hence the
problem I'm having).

I tried changing the above directives to their older directive names (I
also changed the order slightly, which may be irrelevant):

--------------------
plugin {
  antispam_debug_target = syslog
  antispam_verbose_debug = 1
  antispam_backend = pipe
  antispam_mail_spam  = --spam
  antispam_mail_notspam  = --ham
  antispam_mail_sendmail = /usr/bin/sa-learn-pipe.sh
  antispam_spam_pattern_ignorecase = spam;junk
}
--------------------

This changed the message in my IMAP client, when attempting to move a
message from my Inbox to the Junk folder, to:

"[SERVERBUG] failed to send mail"

Does this indicate a problem with the "/usr/bin/sa-learn-pipe.sh" script
that is provided on the Wiki (cited above)?

Also, it was not clear from the documentation (
http://johannes.sipsolutions.net/files/antispam.html ) whether or not
the Pipe back-end requires the X-DSPAM-Signature header, and if so, to
what value it should be set when using SpamAssassin.

Thanks for any pointers,

-Ben



More information about the dovecot mailing list