[Dovecot] Have problem with antispam plugin

gerasew at gmail.com gerasew at gmail.com
Thu Apr 8 09:23:11 EEST 2010


I downloaded the source code plug-in version 1.3 from 
http://johannes.sipsolutions.net/download/dovecot-antispam/
Unpack and make from this .config file:

     BACKEND=mailtrain
     DOVECOT=/usr/include/dovecot
     INSTALLDIR=/usr/lib/dovecot/modules/imap
     USER=root
     GROUP=root
     DEBUG=syslog
     DEBUG_VERBOSE=1
     PLUGINNAME=antispam


Dovecot cofing file:

     protocol imap {
       login_executable = /usr/lib/dovecot/imap-login
       mail_executable = /usr/lib/dovecot/imap
       mail_plugins = quota imap_quota antispam
     }

     plugin {
       antispam_mail_sendmail = /usr/bin/sa-learn
       antispam_mail_spam = --spam
       antispam_mail_notspam = --ham
       antispam_mail_tmpdir = /tmp
       antispam_trash_pattern_ignorecase = trash;Deleted *
       antispam_spam_pattern_ignorecase = junk;spam
     }


When move message into\from "Spam" folder get error:

     [SERVERBUG] failed to send email

In syslog:

     imap: antispam: plugin initialising (1.3-notgit)
     dovecot: IMAP(test at u-kon.ru): Loading modules from directory: 
/usr/lib/dovecot/modules/imap
     dovecot: IMAP(test at u-kon.ru): Module loaded: 
/usr/lib/dovecot/modules/imap/lib10_quota_plugin.so
     dovecot: IMAP(test at u-kon.ru): Module loaded: 
/usr/lib/dovecot/modules/imap/lib11_imap_quota_plugin.so
     dovecot: IMAP(test at u-kon.ru): Module loaded: 
/usr/lib/dovecot/modules/imap/lib90_antispam_plugin.so
     dovecot: IMAP(test at u-kon.ru): Effective uid=8, gid=12, home=(none)
     dovecot: IMAP(test at u-kon.ru): Quota root: name= backend=maildir args=
     dovecot: IMAP(test at u-kon.ru): Quota rule: root= mailbox=* 
bytes=2134810624 messages=0
     dovecot: imap-login: Login: user=<test at u-kon.ru>, method=PLAIN, 
rip=192.168.10.59, lip=192.168.10.77, TLS
     imap: antispam: "trash" is case-insensitive wildcard match trash folder
     imap: antispam: "deleted *" is case-insensitive wildcard match 
trash folder
     imap: antispam: "SPAM" is exact match spam folder
     imap: antispam: "junk" is case-insensitive wildcard match spam folder
     imap: antispam: "spam" is case-insensitive wildcard match spam folder
     imap: antispam: no unsure folders
     imap: antispam: mail backend spam address --spam
     imap: antispam: mail backend not-spam address --ham
     imap: antispam: mail backend sendmail /usr/bin/sa-learn
     imap: antispam: mail backend sendmail arg --single
     imap: antispam: mail backend tmpdir /tmp
     dovecot: IMAP(test at u-kon.ru): maildir: 
data=/var/spool/mail/test at u-kon.ru
     dovecot: IMAP(test at u-kon.ru): maildir++: 
root=/var/spool/mail/test at u-kon.ru, index=, control=, 
inbox=/var/spool/mail/test at u-kon.ru
     dovecot: IMAP(test at u-kon.ru): Namespace : Using permissions from 
/var/spool/mail/test at u-kon.ru: mode=0700 gid=-1
     imap: antispam: mailbox_is_unsure(Junk): 0
     imap: antispam: mailbox_is_trash(INBOX): 0
     imap: antispam: mailbox_is_trash(Junk): 0
     imap: antispam: mail copy: from trash: 0, to trash: 0
     imap: antispam: mailbox_is_spam(INBOX): 0
     imap: antispam: mailbox_is_spam(Junk): 1
     imap: antispam: mailbox_is_unsure(INBOX): 0
     imap: antispam: mail copy: src spam: 0, dst spam: 1, src unsure: 0
     imap: antispam: running mailtrain backend program /usr/bin/sa-learn
     imap: antispam: running mailtrain backend program /usr/bin/sa-learn
     imap: antispam: run program failed with exit code 9


Get sa-learn output from help this script:

     #!/bin/bash

     (
       id -a
       sa-learn
       rc=$?
       echo "exit code $rc"
       exit $rc
     ) > /tmp/antispam.out.$$ 2> /tmp/antispam.err.$$

antispam.err - contains output as "sa-learn --help"

So this means that the call comes without any parameters or with 
incorrect parameters.
I need this to work, please help.


More information about the dovecot mailing list