-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 31 Mar 2015, Anthony Papillion wrote:

Date: Tue, 31 Mar 2015 18:37:34 -0500
From: Anthony Papillion <anth...@cajuntechie.org>
To: dovecot@dovecot.org
Subject: Need a bit of help with the antispam plugin

Hello Everyone,

I'm running the antispam plugin on Dovecot 2.0.19 on Ubuntu Server 14.04
and I can't seem to get it to work. In the IMAP section of dovecot.conf
I have the following lines:

protocol imap {
   mail_plugins = $mail_plugins imap_quota imap_acl antispam
#    mail_plugins = $mail_plugins imap_quota imap_acl
   imap_client_workarounds = tb-extra-mailbox-sep

   # Maximum number of IMAP connections allowed for a user from each IP
address.
   # NOTE: The username is compared case-sensitively.
   # Default is 10.
   # Increase it to avoid issue like below:
   # "Maximum number of concurrent IMAP connections exceeded"
   mail_max_userip_connections = 20

plugin {
 antispam_debug_target = syslog
 antispam_verbose_debug = 1

 antispam_backend = pipe
 antispam_trash = Trash
 antispam_spam = Junk
 antispam_pipe_program_spam_arg = --spam
 antispam_pipe_program_notspam_arg = --ham
 antispam_pipe_program = /usr/bin/sa-learn
 antispam_pipe_program_args = --username=%Lu
}
}

replace the value of antispam_pipe_program with a script:

======
#/bin/bash

(
set -x
id -a
date
/usr/bin/sa-learn "$@"
rc=$?
echo rc=$rc
exit $rc
) >/tmp/antispam.$$.log 2>&1
====

Then check on the command line, what happens if you invoke the command line as the user displayed by the id command.

For some reason, when I try to move something to Junk, I get the
following in my syslog:

Mar 31 18:27:16 anonymail imap: antispam: plugin initialising (2.0-notgit)
Mar 31 18:27:16 anonymail imap: antispam: verbose debug enabled
Mar 31 18:27:16 anonymail imap: antispam: "Junk" is exact match spam folder
Mar 31 18:27:16 anonymail imap: antispam: no unsure folders
Mar 31 18:27:16 anonymail imap: antispam: "Trash" is exact match trash
folder
Mar 31 18:27:16 anonymail imap: antispam: pipe backend spam argument =
--spam
Mar 31 18:27:16 anonymail imap: antispam: pipe backend not-spam argument
= --ham
Mar 31 18:27:16 anonymail imap: antispam: pipe backend program =
/usr/bin/sa-learn
Mar 31 18:27:16 anonymail imap: antispam: pipe backend program arg[0] =
--username=anth...@cajuntechie.org
Mar 31 18:27:16 anonymail imap: antispam: pipe backend tmpdir /tmp
Mar 31 18:27:19 anonymail imap: antispam: mailbox_is_unsure(Junk): 0
Mar 31 18:27:19 anonymail imap: antispam: mailbox_is_trash(INBOX): 0
Mar 31 18:27:19 anonymail imap: antispam: mailbox_is_trash(Junk): 0
Mar 31 18:27:19 anonymail imap: antispam: mail copy: from trash: 0, to
trash: 0
Mar 31 18:27:19 anonymail imap: antispam: mailbox_is_spam(INBOX): 0
Mar 31 18:27:19 anonymail imap: antispam: mailbox_is_spam(Junk): 1
Mar 31 18:27:19 anonymail imap: antispam: mailbox_is_unsure(INBOX): 0
Mar 31 18:27:19 anonymail imap: antispam: mail copy: src spam: 0, dst
spam: 1, src unsure: 0
Mar 31 18:27:19 anonymail imap: antispam: running mailtrain backend
program /usr/bin/sa-learn
Mar 31 18:27:19 anonymail imap: antispam: running mailtrain backend
program /usr/bin/sa-learn
Mar 31 18:27:19 anonymail imap: antispam: running mailtrain backend
program parameter 1 --username=anth...@cajuntechie.org
Mar 31 18:27:19 anonymail imap: antispam: running mailtrain backend
program parameter 2 --spam
Mar 31 18:27:21 anonymail imap: antispam: run program failed with exit
code -1

This is probably a permissions issue but I'm not able to debug it. Can
anyone offer me any clues as to what I might be doing wrong or how I
might fix it?

Thanks,
Anthony



- -- Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEVAwUBVSOh1nz1H7kL/d9rAQJpQQf/ZJzphWeULzGdh9OssSdAk6WTfjQU+ITr
G3YcACkVo9ZWjxeDtF1epXRv8ZibUk+o8Sfj7lQ7YREkC/Xws2MibJh2iIKoAZY8
ZPxGGO14fOiAqOaMDCtyPVoKY97TdhNoNXXbOReQqyEMgVdAF2mrKN4xwphjGWKB
Q5C165UwzphwtnSkWVtMKQvy5o8cQJHltuZa7hyRohsNUwYUu9Qc63qfJf4bxsQH
3O125rfgRX8k6icMb8nmny/g0rWAWhuqVIIgrlS8FE85DuQSlZCcRkSvxn0kHoPy
yP3GVdTQcIN8pxTkyHFyFtzwuF60sEOdZcuYHKSdCb4DjWN0Ph3KSw==
=IPFw
-----END PGP SIGNATURE-----

Reply via email to