Guillaume Lakano - DOVECOT
2015-Aug-21 09:49 UTC
plugin antispam sa-learn run program failed with exit code -1
Hello ! I've installed iRedMail on an Ubuntu Server 14.04.1 I'm not the only one on the iRedMail forum to have the problem, but the developpers of iRedMail doesn't found the problem and advice me to ask you directly. When I want to move an email directly to /Junk/ this not works. In Thunderbird, the error is : "[SERVERBUG] failed to send mail" In RoundCube, the error is : "Server Error: UID MOVE: failed to send mail ." But, if we firstly delete the email, then move the email from /Trash/ to /Junk/ this works. Here is the package versions: dovecot 2.2.9-1ubuntu2.1 dovecot-antispam 2.0+20130822-2build1 spamassassin 3.4.0-1ubuntu2.1 I have enabled antispam-debug in syslog, and the sa-learn seems to return an error: Aug 20 20:21:13 mail imap: antispam: plugin initialising (2.0-notgit) Aug 20 20:21:13 mail imap: antispam: verbose debug enabled Aug 20 20:21:13 mail imap: antispam: "Junk" is exact match spam folder Aug 20 20:21:13 mail imap: antispam: no unsure folders Aug 20 20:21:13 mail imap: antispam: "Trash" is exact match trash folder Aug 20 20:21:13 mail imap: antispam: pipe backend spam argument = --spam Aug 20 20:21:13 mail imap: antispam: pipe backend not-spam argument = --ham Aug 20 20:21:13 mail imap: antispam: pipe backend program = /usr/bin/sa-learn Aug 20 20:21:13 mail imap: antispam: pipe backend program arg[0] = -D --username=guillaume.XXXX at nydomain.com Aug 20 20:21:13 mail imap: antispam: pipe backend tmpdir /tmp Aug 20 20:21:14 mail imap: antispam: mailbox_is_unsure(Junk): 0 Aug 20 20:21:14 mail imap: antispam: mailbox_is_trash(INBOX): 0 Aug 20 20:21:14 mail imap: antispam: mailbox_is_trash(Junk): 0 Aug 20 20:21:14 mail imap: antispam: mail copy: from trash: 0, to trash: 0 Aug 20 20:21:14 mail imap: antispam: mailbox_is_spam(INBOX): 0 Aug 20 20:21:14 mail imap: antispam: mailbox_is_spam(Junk): 1 Aug 20 20:21:14 mail imap: antispam: mailbox_is_unsure(INBOX): 0 Aug 20 20:21:14 mail imap: antispam: mail copy: src spam: 0, dst spam: 1, src unsure: 0 Aug 20 20:21:14 mail imap: antispam: running mailtrain backend program /usr/bin/sa-learn Aug 20 20:21:14 mail imap: antispam: running mailtrain backend program /usr/bin/sa-learn Aug 20 20:21:14 mail imap: antispam: running mailtrain backend program parameter 1 -D --username=guillaume.XXXX at mydomain.com Aug 20 20:21:14 mail imap: antispam: running mailtrain backend program parameter 2 --spam Aug 20 20:21:16 mail imap: antispam: run program failed with exit code -1 There is no other log in /var/log/dovecot.log or /var/log/mail.log Here is my dovecot configuration: # dovecot -n # 2.2.9: /etc/dovecot/dovecot.conf # OS: Linux 3.13.0-62-generic x86_64 Ubuntu 14.04.1 LTS auth_master_user_separator = * auth_mechanisms = PLAIN LOGIN dict { acl = mysql:/etc/dovecot/dovecot-share-folder.conf quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf } first_valid_uid = 2000 last_valid_uid = 2000 listen = * [::] log_path = /var/log/dovecot.log mail_gid = 2000 mail_location = maildir:%Lh/Maildir/:INDEX=%Lh/Maildir/ mail_plugins = quota mailbox_alias acl mail_uid = 2000 managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave namespace { inbox = yes location mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Junk { auto = subscribe special_use = \Junk } mailbox Sent { auto = subscribe special_use = \Sent } mailbox "Sent Messages" { auto = no special_use = \Sent } mailbox Spam { auto = no special_use = \Junk } mailbox Trash { auto = subscribe special_use = \Trash } prefix separator = / type = private } namespace { list = children location = maildir:%%Lh/Maildir/:INDEX=%%Lh/Maildir/Shared/%%u prefix = Shared/%%u/ separator = / subscriptions = yes type = shared } passdb { args = /etc/dovecot/dovecot-mysql.conf driver = sql } passdb { args = /etc/dovecot/dovecot-master-users driver = passwd-file master = yes } plugin { acl = vfile acl_shared_dict = proxy::acl antispam_backend = pipe antispam_debug_target = syslog antispam_pipe_program = /usr/bin/sa-learn antispam_pipe_program_args = --username=%Lu antispam_pipe_program_notspam_arg = --ham antispam_pipe_program_spam_arg = --spam antispam_spam = Junk antispam_trash = Trash antispam_verbose_debug = 1 auth_socket_path = /var/run/dovecot/auth-master mailbox_alias_new = Sent Messages mailbox_alias_new2 = Sent Items mailbox_alias_old = Sent mailbox_alias_old2 = Sent quota = dict:user::proxy::quotadict quota_rule = *:storage=1G quota_warning = storage=85%% quota-warning 85 %u quota_warning2 = storage=90%% quota-warning 90 %u quota_warning3 = storage=95%% quota-warning 95 %u sieve = %Lh/sieve/dovecot.sieve sieve_before = /var/vmail/sieve/dovecot.sieve sieve_dir = %Lh/sieve sieve_execute_bin_dir = /usr/lib/dovecot/sieve-execute sieve_filter_bin_dir = /usr/lib/dovecot/sieve-filter sieve_global_dir = /var/vmail/sieve sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.filter +vnd.dovecot.execute sieve_pipe_bin_dir = /usr/lib/dovecot/sieve-pipe sieve_plugins = sieve_extprograms } protocols = pop3 imap sieve lmtp service auth { unix_listener /var/spool/postfix/private/dovecot-auth { group = postfix mode = 0666 user = postfix } unix_listener auth-master { group = vmail mode = 0666 user = vmail } unix_listener auth-userdb { group = vmail mode = 0660 user = vmail } } service dict { unix_listener dict { group = vmail mode = 0660 user = vmail } } service imap-login { process_limit = 500 service_count = 1 } service lmtp { executable = lmtp -L inet_listener lmtp { address = 127.0.0.1 port = 24 } process_min_avail = 5 unix_listener /var/spool/postfix/private/dovecot-lmtp { group = postfix mode = 0600 user = postfix } user = vmail } service managesieve-login { inet_listener sieve { address = 127.0.0.1 port = 4190 } } service pop3-login { service_count = 1 } service quota-warning { executable = script /usr/local/bin/dovecot-quota-warning.sh unix_listener quota-warning { group = vmail mode = 0660 user = vmail } } ssl = required ssl_cert = </etc/ssl/certs/iRedMail.crt ssl_cipher_list = ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA ssl_dh_parameters_length = 2048 ssl_key = </etc/ssl/private/iRedMail.key ssl_prefer_server_ciphers = yes ssl_protocols = !SSLv2 !SSLv3 userdb { args = /etc/dovecot/dovecot-mysql.conf driver = sql } protocol lda { auth_socket_path = /var/run/dovecot/auth-master lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes log_path = /var/log/dovecot-sieve.log mail_plugins = quota mailbox_alias acl sieve postmaster_address = root } protocol lmtp { info_log_path = /var/log/dovecot-lmtp.log lmtp_save_to_detail_mailbox = yes mail_plugins = quota sieve postmaster_address = postmaster recipient_delimiter = + } protocol imap { imap_client_workarounds = tb-extra-mailbox-sep mail_max_userip_connections = 20 mail_plugins = quota mailbox_alias acl imap_quota imap_acl antispam } protocol pop3 { mail_max_userip_connections = 20 mail_plugins = quota mailbox_alias acl pop3_client_workarounds = outlook-no-nuls oe-ns-eoh pop3_uidl_format = %08Xu%08Xv } I don't known if it's a problem related to dovecot or to spamassassin. If you could help me to solve the problem, this will be really appreciated :) Regards
Andrew McN
2015-Aug-21 13:51 UTC
plugin antispam sa-learn run program failed with exit code -1
On 21/08/15 19:49, Guillaume Lakano - DOVECOT wrote:> Aug 20 20:21:14 mail imap: antispam: running mailtrain backend program parameter 1 -D --username=guillaume.XXXX at mydomain.com > Aug 20 20:21:14 mail imap: antispam: running mailtrain backend program parameter 2 --spamThat looks like it should be three parameters, not two? Also, read this: http://wiki2.dovecot.org/Plugins/Antispam#Backend_-_mailtrain_realtime_sa-learn Andrew
Steffen Kaiser
2015-Aug-21 14:21 UTC
plugin antispam sa-learn run program failed with exit code -1
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, 21 Aug 2015, Guillaume Lakano - DOVECOT wrote:> Aug 20 20:21:14 mail imap: antispam: running mailtrain backend program > /usr/bin/sa-learn > Aug 20 20:21:14 mail imap: antispam: running mailtrain backend program > /usr/bin/sa-learn > Aug 20 20:21:14 mail imap: antispam: running mailtrain backend program > parameter 1 -D --username=guillaume.XXXX at mydomain.com > Aug 20 20:21:14 mail imap: antispam: running mailtrain backend program > parameter 2 --spam > Aug 20 20:21:16 mail imap: antispam: run program failed with exit code -1- -1 usually means exec() failed, that is: /usr/bin/sa-learn does not exist or the process thinks so at least. Do you have SELinux active? http://wiki2.dovecot.org/WhyDoesItNotWork near the end. If this does not help, add a wrapper script in your config and check if the script is called at least - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEVAwUBVdcz83z1H7kL/d9rAQKTywf/dhX5NOxUTjLQXIVAI+iOyyvLuncrG4q1 B3HMhGhRjAfGX5nvJnzSI+YFn/PTaZyrs1B8gjaNz4VyW54GcSqUiycG3NZGAv6x uLd1cjIY9UFVl2VB1uyUitVWmioNrsXzq07I5iKf9XT6h4B0XyIVCKHCWt7t9vCc HesPN+Eu6fFSRXNeP1u8Qded/iyAD4Qd/AodIBwcO1gSNgjMhrDF9phYJZHFudLZ HlMvC2SOPB3TDNUdYqdK2ZDS8v7zN6wsKrxEQorWGoqv1vRDRBczm7h+oTSmI0T9 sMo/lHtrWY19As4t9ghr3sBjpwHr+fcQnV3gAkk+x9qHCCKxjT68gw==Hfaj -----END PGP SIGNATURE-----
Guillaume Lakano - DOVECOT
2015-Aug-21 14:37 UTC
plugin antispam sa-learn run program failed with exit code -1
Le 21/08/2015 16:21, Steffen Kaiser a ?crit :> > - -1 usually means exec() failed, that is: > > /usr/bin/sa-learn does not exist or the process thinks so at least.Hello Steffen, thanks for your reply. I've tried to use an external script sa-learn-pipe.sh :> #!/bin/bash > echo /usr/bin/sa-learn $* /tmp/sendmail-msg-$$.txt echo "$$-start > ($*)" >> /tmp/sa-learn-pipe.log > echo $* > /tmp/sendmail-parms.txt cat<&0 >> /tmp/sendmail-msg-$$.txt > /usr/bin/sa-learn $* /tmp/sendmail-msg-$$.txt && rm -f > /tmp/sendmail-msg-$$.txt & > echo "$$-end" >> /tmp/sa-learn-pipe.log > exit 0And to update my configuration like that:> > antispam_debug_target = syslog > antispam_verbose_debug = 1 > > antispam_backend = pipe > antispam_pipe_program_spam_arg = --spam > antispam_pipe_program_notspam_arg = --ham > antispam_pipe_program = /usr/local/bin/sa-learn-pipe.sh > antispam_pipe_program_args = --username=%LuNow, this seems better, no error, the email is correctly moved in /Junk/ and I have no error> Aug 21 16:31:05 mail imap: antispam: mailbox_is_unsure(Junk): 0 > Aug 21 16:31:05 mail imap: antispam: mailbox_is_trash(INBOX): 0 > Aug 21 16:31:05 mail imap: antispam: mailbox_is_trash(Junk): 0 > Aug 21 16:31:05 mail imap: antispam: mail copy: from trash: 0, to trash: 0 > Aug 21 16:31:05 mail imap: antispam: mailbox_is_spam(INBOX): 0 > Aug 21 16:31:05 mail imap: antispam: mailbox_is_spam(Junk): 0 > Aug 21 16:31:05 mail imap: antispam: mailbox_is_unsure(INBOX): 0 > Aug 21 16:31:05 mail imap: antispam: mail copy: src spam: 0, dst spam: > 0, src unsure: 0BUT... the sa-learn-pipe.sh doesn't seems to be called ! No files created in /tmp/ :-( I also tried to use the "mailtrain" backend but Dovecot doesn't accept it ( I suppose I need to set "antispam_backend" to "mailtrain" but this doesn't works ).> > Do you have SELinux active? http://wiki2.dovecot.org/WhyDoesItNotWork > near the end.sestatus doesn't exists, package not installed ( policycoreutils ) and no file /var/log/audit* So I suppose iRedMail doesn't install SELinux components.> > If this does not help, add a wrapper script in your config and check > if the script is called at least >It's not called at all :-/
Guillaume Lakano - DOVECOT
2015-Aug-21 14:38 UTC
plugin antispam sa-learn run program failed with exit code -1
Le 21/08/2015 15:51, Andrew McN a ?crit :> On 21/08/15 19:49, Guillaume Lakano - DOVECOT wrote: >> Aug 20 20:21:14 mail imap: antispam: running mailtrain backend program parameter 1 -D --username=guillaume.XXXX at mydomain.com >> Aug 20 20:21:14 mail imap: antispam: running mailtrain backend program parameter 2 --spam > That looks like it should be three parameters, not two?Hello Andrew, thanks for your answer :) Sorry about the previous copy/paste, this was a wrong previous test ( I've tested to inject others arguments to see if dovecot still report the error or no... ) Here is the the same logs :> Aug 21 16:04:37 mail imap: antispam: plugin initialising (2.0-notgit) > Aug 21 16:04:37 mail imap: antispam: verbose debug enabled > Aug 21 16:04:37 mail imap: antispam: "Junk" is exact match spam folder > Aug 21 16:04:37 mail imap: antispam: no unsure folders > Aug 21 16:04:37 mail imap: antispam: "Trash" is exact match trash folder > Aug 21 16:04:37 mail imap: antispam: pipe backend spam argument = --spam > Aug 21 16:04:37 mail imap: antispam: pipe backend not-spam argument = > --ham > Aug 21 16:04:37 mail imap: antispam: pipe backend program = > /usr/bin/sa-learn > Aug 21 16:04:37 mail imap: antispam: pipe backend program arg[0] = > --username=guillaume.XXXX at mydomain.com > Aug 21 16:04:37 mail imap: antispam: pipe backend tmpdir /tmp > Aug 21 16:04:37 mail imap: antispam: mailbox_is_unsure(Junk): 0 > Aug 21 16:04:37 mail imap: antispam: mailbox_is_trash(INBOX): 0 > Aug 21 16:04:37 mail imap: antispam: mailbox_is_trash(Junk): 0 > Aug 21 16:04:37 mail imap: antispam: mail copy: from trash: 0, to trash: 0 > Aug 21 16:04:37 mail imap: antispam: mailbox_is_spam(INBOX): 0 > Aug 21 16:04:37 mail imap: antispam: mailbox_is_spam(Junk): 1 > Aug 21 16:04:37 mail imap: antispam: mailbox_is_unsure(INBOX): 0 > Aug 21 16:04:37 mail imap: antispam: mail copy: src spam: 0, dst spam: > 1, src unsure: 0 > Aug 21 16:04:37 mail imap: antispam: running mailtrain backend program > /usr/bin/sa-learn > Aug 21 16:04:37 mail imap: antispam: running mailtrain backend program > /usr/bin/sa-learn > Aug 21 16:04:37 mail imap: antispam: running mailtrain backend program > parameter 1 --username=guillaume.XXXX at mydomain.com > Aug 21 16:04:37 mail imap: antispam: running mailtrain backend program > parameter 2 --spam > Aug 21 16:04:39 mail imap: antispam: run program failed with exit code -1 > Aug 21 16:04:46 mail imap: antispam: plugin initialising (2.0-notgit) > Aug 21 16:04:46 mail imap: antispam: verbose debug enabled > Aug 21 16:04:46 mail imap: antispam: "Junk" is exact match spam folder > Aug 21 16:04:46 mail imap: antispam: no unsure folders > Aug 21 16:04:46 mail imap: antispam: "Trash" is exact match trash folder > Aug 21 16:04:46 mail imap: antispam: pipe backend spam argument = --spam > Aug 21 16:04:46 mail imap: antispam: pipe backend not-spam argument = > --ham > Aug 21 16:04:46 mail imap: antispam: pipe backend program = > /usr/bin/sa-learn > Aug 21 16:04:46 mail imap: antispam: pipe backend program arg[0] = > --username=guillaume.XXXX at mydomain.com > Aug 21 16:04:46 mail imap: antispam: pipe backend tmpdir /tmp > Aug 21 16:04:46 mail imap: antispam: plugin initialising (2.0-notgit) > Aug 21 16:04:46 mail imap: antispam: verbose debug enabled > Aug 21 16:04:46 mail imap: antispam: "Junk" is exact match spam folder > Aug 21 16:04:46 mail imap: antispam: no unsure folders > Aug 21 16:04:46 mail imap: antispam: "Trash" is exact match trash folder > Aug 21 16:04:46 mail imap: antispam: pipe backend spam argument = --spam > Aug 21 16:04:46 mail imap: antispam: pipe backend not-spam argument = > --ham > Aug 21 16:04:46 mail imap: antispam: pipe backend program = > /usr/bin/sa-learn > Aug 21 16:04:46 mail imap: antispam: pipe backend program arg[0] = > --username=guillaume.XXXX at mydomain.com > Aug 21 16:04:46 mail imap: antispam: pipe backend tmpdir /tmp> Also, read this: > > > http://wiki2.dovecot.org/Plugins/Antispam#Backend_-_mailtrain_realtime_sa-learnOk I'll try to use an external pipe to script Thanks -- ------------------------------------------------------------------------ *NOX DIGITAL* Guillaume Lecanu
Maybe Matching Threads
- plugin antispam sa-learn run program failed with exit code -1
- Need a bit of help with the antispam plugin
- antispam plugin, pipe backend, how to make it work?
- antispam plugin, pipe backend, how to make it work?
- antispam plugin pipe script seems not to be called when it "should be"