Hello, I try to use the plugin for my dovecot in debian. It seem that the /usr/bin/sa-learn-pipe.sh is not execute. When I run /usr/bin/sa-learn-pipe.sh from commandline logfiles are created. I also read https://johannes.sipsolutions.net/files/antispam.html In syslog you can see fist move a mail from "z_SPAM" to INBOX and then move a mail from INBOX to "z_SPAM". Can you please help? Best regards Config and log's are append. dpkg -l | grep dovecot ii dovecot-antispam 2.0+20130912-2 amd64 Dovecot plugins for training spam filters ii dovecot-core 1:2.2.13-12~deb8u1 amd64 secure POP3/IMAP server - core files ii dovecot-imapd 1:2.2.13-12~deb8u1 amd64 secure POP3/IMAP server - IMAP daemon ii dovecot-pgsql 1:2.2.13-12~deb8u1 amd64 secure POP3/IMAP server - PostgreSQL support ### log root at vsrv78105:/etc/dovecot# /etc/init.d/dovecot restart [ ok ] Restarting dovecot (via systemctl): dovecot.service. root at vsrv78105:/etc/dovecot# tail -f /var/log/syslog | grep imap Nov 3 20:02:45 vsrv78105 dovecot: imap-login: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill) Nov 3 20:02:48 vsrv78105 dovecot: master: Dovecot v2.2.13 starting up for imap (core dumps disabled) Nov 3 20:03:03 vsrv78105 dovecot: imap-login: Login: user=<xxx>, method=PLAIN, rip=xxx, lip=xxx, mpid=14954, TLS, session=<pqb/NGpAvgBP8o1u> Nov 3 20:03:03 vsrv78105 imap: antispam: plugin initialising (2.0-notgit) Nov 3 20:03:03 vsrv78105 imap: antispam: verbose debug enabled Nov 3 20:03:03 vsrv78105 imap: antispam: "Spam" is exact match spam folder Nov 3 20:03:03 vsrv78105 imap: antispam: "SPAM" is exact match spam folder Nov 3 20:03:03 vsrv78105 imap: antispam: "z_SPAM" is exact match spam folder Nov 3 20:03:03 vsrv78105 imap: antispam: no unsure folders Nov 3 20:03:03 vsrv78105 imap: antispam: "Trash" is exact match trash folder Nov 3 20:03:03 vsrv78105 imap: antispam: "trash" is exact match trash folder Nov 3 20:03:03 vsrv78105 imap: antispam: pipe backend tmpdir /tmp Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_unsure(INBOX): 0 Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_trash(z_SPAM): 0 Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_trash(INBOX): 0 Nov 3 20:03:13 vsrv78105 imap: antispam: mail copy: from trash: 0, to trash: 0 Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_spam(z_SPAM): 0 Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_spam(INBOX): 0 Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_unsure(z_SPAM): 0 Nov 3 20:03:13 vsrv78105 imap: antispam: mail copy: src spam: 0, dst spam: 0, src unsure: 0 Nov 3 20:03:14 vsrv78105 dovecot: imap-login: Login: user=<xxx>, method=PLAIN, rip=xxx, lip=xxx, mpid=14959, TLS, session=<KxqnNWpAvwBP8o1u> Nov 3 20:03:14 vsrv78105 imap: antispam: plugin initialising (2.0-notgit) Nov 3 20:03:14 vsrv78105 imap: antispam: verbose debug enabled Nov 3 20:03:14 vsrv78105 imap: antispam: "Spam" is exact match spam folder Nov 3 20:03:14 vsrv78105 imap: antispam: "SPAM" is exact match spam folder Nov 3 20:03:14 vsrv78105 imap: antispam: "z_SPAM" is exact match spam folder Nov 3 20:03:14 vsrv78105 imap: antispam: no unsure folders Nov 3 20:03:14 vsrv78105 imap: antispam: "Trash" is exact match trash folder Nov 3 20:03:14 vsrv78105 imap: antispam: "trash" is exact match trash folder Nov 3 20:03:14 vsrv78105 imap: antispam: pipe backend tmpdir /tmp Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_unsure(z_SPAM): 0 Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_trash(INBOX): 0 Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_trash(z_SPAM): 0 Nov 3 20:04:05 vsrv78105 imap: antispam: mail copy: from trash: 0, to trash: 0 Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_spam(INBOX): 0 Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_spam(z_SPAM): 0 Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_unsure(INBOX): 0 Nov 3 20:04:05 vsrv78105 imap: antispam: mail copy: src spam: 0, dst spam: 0, src unsure: 0 ^C root at vsrv78105:/etc/dovecot# ls -la /tmp/ insgesamt 8864 drwxrwxrwt 8 root root 12288 Nov 3 20:07 . drwxr-xr-x 22 root root 4096 Jun 17 14:41 .. drwxrwxrwt 2 root root 4096 Nov 1 14:16 .font-unix drwxrwxrwt 2 root root 4096 Nov 1 14:16 .ICE-unix drwxrwxrwt 2 root root 4096 Nov 1 14:16 .Test-unix drwxrwxrwt 2 root root 4096 Nov 1 14:16 .X11-unix drwxrwxrwt 2 root root 4096 Nov 1 14:16 .XIM-unix root at vsrv78105:/etc/dovecot# ls -la /etc/dovecot/sa-learn-pipe.sh -rwxr-xr-x 1 root root 769 Nov 3 19:38 /etc/dovecot/sa-learn-pipe.sh ######################### config ### 90-plugin.conf plugin { #setting_name = value antispam_backend = pipe antispam_debug_target = syslog antispam_verbose_debug = 1 # antispam_mail_sendmail_args= --username=%u antispam_mail_spam_arg = --spam antispam_mail_notspam_arg = --ham antispam_mail_program = /etc/dovecot/sa-learn-pipe.sh antispam_spam = Spam;SPAM;z_SPAM antispam_trash = Trash;trash } ### sa-learn-pipe.sh #!/bin/bash set -x pid=$$ # remove the # from next line to background learner #( { echo "$(date) ${pid}-start ($*) /tmp/sendmail-msg-$$.txt" set -x #id -a #env cat > /tmp/sendmail-msg-${pid}.txt /usr/bin/sa-learn "$@" /tmp/sendmail-msg-${pid}.txt echo "$(date) $$-end rc=$?" } >/tmp/antispam.${pid}.log 2>&1 echo "cat antispam.${pid}.log" cat /tmp/antispam.${pid}.log >>/tmp/sa-learn-pipe.log rm -f /tmp/antispam.${pid}.log /tmp/sendmail-msg-${pid}.txt true # remove the # from next line to background learner #) & exit 0
Hi, The package in debian/ubuntu is based on http://wiki2.dovecot.org/Plugins/Antispam, which is a fork/rewrite of the plugin by johannes at sipsolutions. Try to set it again using the correct documentation :) Regards, Tom On 03-11-16 21:12, basti wrote:> Hello, > I try to use the plugin for my dovecot in debian. > It seem that the /usr/bin/sa-learn-pipe.sh is not execute. > When I run /usr/bin/sa-learn-pipe.sh from commandline logfiles are created. > I also read https://johannes.sipsolutions.net/files/antispam.html > > In syslog you can see fist move a mail from "z_SPAM" to INBOX and then > move a mail from INBOX to "z_SPAM". > > Can you please help? > Best regards > > Config and log's are append. > > dpkg -l | grep dovecot > ii dovecot-antispam 2.0+20130912-2 > amd64 Dovecot plugins for training spam filters > ii dovecot-core 1:2.2.13-12~deb8u1 > amd64 secure POP3/IMAP server - core files > ii dovecot-imapd 1:2.2.13-12~deb8u1 > amd64 secure POP3/IMAP server - IMAP daemon > ii dovecot-pgsql 1:2.2.13-12~deb8u1 > amd64 secure POP3/IMAP server - PostgreSQL support > > ### log > root at vsrv78105:/etc/dovecot# /etc/init.d/dovecot restart > [ ok ] Restarting dovecot (via systemctl): dovecot.service. > root at vsrv78105:/etc/dovecot# tail -f /var/log/syslog | grep imap > Nov 3 20:02:45 vsrv78105 dovecot: imap-login: Warning: Killed with > signal 15 (by pid=1 uid=0 code=kill) > Nov 3 20:02:48 vsrv78105 dovecot: master: Dovecot v2.2.13 starting up > for imap (core dumps disabled) > Nov 3 20:03:03 vsrv78105 dovecot: imap-login: Login: user=<xxx>, > method=PLAIN, rip=xxx, lip=xxx, mpid=14954, TLS, session=<pqb/NGpAvgBP8o1u> > Nov 3 20:03:03 vsrv78105 imap: antispam: plugin initialising (2.0-notgit) > Nov 3 20:03:03 vsrv78105 imap: antispam: verbose debug enabled > Nov 3 20:03:03 vsrv78105 imap: antispam: "Spam" is exact match spam folder > Nov 3 20:03:03 vsrv78105 imap: antispam: "SPAM" is exact match spam folder > Nov 3 20:03:03 vsrv78105 imap: antispam: "z_SPAM" is exact match spam > folder > Nov 3 20:03:03 vsrv78105 imap: antispam: no unsure folders > Nov 3 20:03:03 vsrv78105 imap: antispam: "Trash" is exact match trash > folder > Nov 3 20:03:03 vsrv78105 imap: antispam: "trash" is exact match trash > folder > Nov 3 20:03:03 vsrv78105 imap: antispam: pipe backend tmpdir /tmp > Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_unsure(INBOX): 0 > Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_trash(z_SPAM): 0 > Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_trash(INBOX): 0 > Nov 3 20:03:13 vsrv78105 imap: antispam: mail copy: from trash: 0, to > trash: 0 > Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_spam(z_SPAM): 0 > Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_spam(INBOX): 0 > Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_unsure(z_SPAM): 0 > Nov 3 20:03:13 vsrv78105 imap: antispam: mail copy: src spam: 0, dst > spam: 0, src unsure: 0 > Nov 3 20:03:14 vsrv78105 dovecot: imap-login: Login: user=<xxx>, > method=PLAIN, rip=xxx, lip=xxx, mpid=14959, TLS, session=<KxqnNWpAvwBP8o1u> > Nov 3 20:03:14 vsrv78105 imap: antispam: plugin initialising (2.0-notgit) > Nov 3 20:03:14 vsrv78105 imap: antispam: verbose debug enabled > Nov 3 20:03:14 vsrv78105 imap: antispam: "Spam" is exact match spam folder > Nov 3 20:03:14 vsrv78105 imap: antispam: "SPAM" is exact match spam folder > Nov 3 20:03:14 vsrv78105 imap: antispam: "z_SPAM" is exact match spam > folder > Nov 3 20:03:14 vsrv78105 imap: antispam: no unsure folders > Nov 3 20:03:14 vsrv78105 imap: antispam: "Trash" is exact match trash > folder > Nov 3 20:03:14 vsrv78105 imap: antispam: "trash" is exact match trash > folder > Nov 3 20:03:14 vsrv78105 imap: antispam: pipe backend tmpdir /tmp > Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_unsure(z_SPAM): 0 > Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_trash(INBOX): 0 > Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_trash(z_SPAM): 0 > Nov 3 20:04:05 vsrv78105 imap: antispam: mail copy: from trash: 0, to > trash: 0 > Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_spam(INBOX): 0 > Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_spam(z_SPAM): 0 > Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_unsure(INBOX): 0 > Nov 3 20:04:05 vsrv78105 imap: antispam: mail copy: src spam: 0, dst > spam: 0, src unsure: 0 > ^C > > root at vsrv78105:/etc/dovecot# ls -la /tmp/ > insgesamt 8864 > drwxrwxrwt 8 root root 12288 Nov 3 20:07 . > drwxr-xr-x 22 root root 4096 Jun 17 14:41 .. > drwxrwxrwt 2 root root 4096 Nov 1 14:16 .font-unix > drwxrwxrwt 2 root root 4096 Nov 1 14:16 .ICE-unix > drwxrwxrwt 2 root root 4096 Nov 1 14:16 .Test-unix > drwxrwxrwt 2 root root 4096 Nov 1 14:16 .X11-unix > drwxrwxrwt 2 root root 4096 Nov 1 14:16 .XIM-unix > > root at vsrv78105:/etc/dovecot# ls -la /etc/dovecot/sa-learn-pipe.sh > -rwxr-xr-x 1 root root 769 Nov 3 19:38 /etc/dovecot/sa-learn-pipe.sh > > ######################### > > config > > ### > 90-plugin.conf > > plugin { > #setting_name = value > > antispam_backend = pipe > antispam_debug_target = syslog > antispam_verbose_debug = 1 > # antispam_mail_sendmail_args= --username=%u > antispam_mail_spam_arg = --spam > antispam_mail_notspam_arg = --ham > antispam_mail_program = /etc/dovecot/sa-learn-pipe.sh > antispam_spam = Spam;SPAM;z_SPAM > antispam_trash = Trash;trash > } > > ### > > sa-learn-pipe.sh > > #!/bin/bash > set -x > pid=$$ > # remove the # from next line to background learner > #( > { > echo "$(date) ${pid}-start ($*) /tmp/sendmail-msg-$$.txt" > set -x > #id -a > #env > > cat > /tmp/sendmail-msg-${pid}.txt > /usr/bin/sa-learn "$@" /tmp/sendmail-msg-${pid}.txt > echo "$(date) $$-end rc=$?" > } >/tmp/antispam.${pid}.log 2>&1 > > echo "cat antispam.${pid}.log" > cat /tmp/antispam.${pid}.log >>/tmp/sa-learn-pipe.log > rm -f /tmp/antispam.${pid}.log /tmp/sendmail-msg-${pid}.txt > true > # remove the # from next line to background learner > #) & > exit 0 >
Hello, I already use this documentation. and after I get this errors I read the man page at https://johannes.sipsolutions.net/files/antispam.html Regards, Basti On 04.11.2016 15:52, Tom Hendrikx wrote:> Hi, > > The package in debian/ubuntu is based on > http://wiki2.dovecot.org/Plugins/Antispam, which is a fork/rewrite of > the plugin by johannes at sipsolutions. Try to set it again using the > correct documentation :) > > Regards, > Tom > > On 03-11-16 21:12, basti wrote: >> Hello, >> I try to use the plugin for my dovecot in debian. >> It seem that the /usr/bin/sa-learn-pipe.sh is not execute. >> When I run /usr/bin/sa-learn-pipe.sh from commandline logfiles are created. >> I also read https://johannes.sipsolutions.net/files/antispam.html >> >> In syslog you can see fist move a mail from "z_SPAM" to INBOX and then >> move a mail from INBOX to "z_SPAM". >> >> Can you please help? >> Best regards >> >> Config and log's are append. >> >> dpkg -l | grep dovecot >> ii dovecot-antispam 2.0+20130912-2 >> amd64 Dovecot plugins for training spam filters >> ii dovecot-core 1:2.2.13-12~deb8u1 >> amd64 secure POP3/IMAP server - core files >> ii dovecot-imapd 1:2.2.13-12~deb8u1 >> amd64 secure POP3/IMAP server - IMAP daemon >> ii dovecot-pgsql 1:2.2.13-12~deb8u1 >> amd64 secure POP3/IMAP server - PostgreSQL support >> >> ### log >> root at vsrv78105:/etc/dovecot# /etc/init.d/dovecot restart >> [ ok ] Restarting dovecot (via systemctl): dovecot.service. >> root at vsrv78105:/etc/dovecot# tail -f /var/log/syslog | grep imap >> Nov 3 20:02:45 vsrv78105 dovecot: imap-login: Warning: Killed with >> signal 15 (by pid=1 uid=0 code=kill) >> Nov 3 20:02:48 vsrv78105 dovecot: master: Dovecot v2.2.13 starting up >> for imap (core dumps disabled) >> Nov 3 20:03:03 vsrv78105 dovecot: imap-login: Login: user=<xxx>, >> method=PLAIN, rip=xxx, lip=xxx, mpid=14954, TLS, session=<pqb/NGpAvgBP8o1u> >> Nov 3 20:03:03 vsrv78105 imap: antispam: plugin initialising (2.0-notgit) >> Nov 3 20:03:03 vsrv78105 imap: antispam: verbose debug enabled >> Nov 3 20:03:03 vsrv78105 imap: antispam: "Spam" is exact match spam folder >> Nov 3 20:03:03 vsrv78105 imap: antispam: "SPAM" is exact match spam folder >> Nov 3 20:03:03 vsrv78105 imap: antispam: "z_SPAM" is exact match spam >> folder >> Nov 3 20:03:03 vsrv78105 imap: antispam: no unsure folders >> Nov 3 20:03:03 vsrv78105 imap: antispam: "Trash" is exact match trash >> folder >> Nov 3 20:03:03 vsrv78105 imap: antispam: "trash" is exact match trash >> folder >> Nov 3 20:03:03 vsrv78105 imap: antispam: pipe backend tmpdir /tmp >> Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_unsure(INBOX): 0 >> Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_trash(z_SPAM): 0 >> Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_trash(INBOX): 0 >> Nov 3 20:03:13 vsrv78105 imap: antispam: mail copy: from trash: 0, to >> trash: 0 >> Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_spam(z_SPAM): 0 >> Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_spam(INBOX): 0 >> Nov 3 20:03:13 vsrv78105 imap: antispam: mailbox_is_unsure(z_SPAM): 0 >> Nov 3 20:03:13 vsrv78105 imap: antispam: mail copy: src spam: 0, dst >> spam: 0, src unsure: 0 >> Nov 3 20:03:14 vsrv78105 dovecot: imap-login: Login: user=<xxx>, >> method=PLAIN, rip=xxx, lip=xxx, mpid=14959, TLS, session=<KxqnNWpAvwBP8o1u> >> Nov 3 20:03:14 vsrv78105 imap: antispam: plugin initialising (2.0-notgit) >> Nov 3 20:03:14 vsrv78105 imap: antispam: verbose debug enabled >> Nov 3 20:03:14 vsrv78105 imap: antispam: "Spam" is exact match spam folder >> Nov 3 20:03:14 vsrv78105 imap: antispam: "SPAM" is exact match spam folder >> Nov 3 20:03:14 vsrv78105 imap: antispam: "z_SPAM" is exact match spam >> folder >> Nov 3 20:03:14 vsrv78105 imap: antispam: no unsure folders >> Nov 3 20:03:14 vsrv78105 imap: antispam: "Trash" is exact match trash >> folder >> Nov 3 20:03:14 vsrv78105 imap: antispam: "trash" is exact match trash >> folder >> Nov 3 20:03:14 vsrv78105 imap: antispam: pipe backend tmpdir /tmp >> Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_unsure(z_SPAM): 0 >> Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_trash(INBOX): 0 >> Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_trash(z_SPAM): 0 >> Nov 3 20:04:05 vsrv78105 imap: antispam: mail copy: from trash: 0, to >> trash: 0 >> Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_spam(INBOX): 0 >> Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_spam(z_SPAM): 0 >> Nov 3 20:04:05 vsrv78105 imap: antispam: mailbox_is_unsure(INBOX): 0 >> Nov 3 20:04:05 vsrv78105 imap: antispam: mail copy: src spam: 0, dst >> spam: 0, src unsure: 0 >> ^C >> >> root at vsrv78105:/etc/dovecot# ls -la /tmp/ >> insgesamt 8864 >> drwxrwxrwt 8 root root 12288 Nov 3 20:07 . >> drwxr-xr-x 22 root root 4096 Jun 17 14:41 .. >> drwxrwxrwt 2 root root 4096 Nov 1 14:16 .font-unix >> drwxrwxrwt 2 root root 4096 Nov 1 14:16 .ICE-unix >> drwxrwxrwt 2 root root 4096 Nov 1 14:16 .Test-unix >> drwxrwxrwt 2 root root 4096 Nov 1 14:16 .X11-unix >> drwxrwxrwt 2 root root 4096 Nov 1 14:16 .XIM-unix >> >> root at vsrv78105:/etc/dovecot# ls -la /etc/dovecot/sa-learn-pipe.sh >> -rwxr-xr-x 1 root root 769 Nov 3 19:38 /etc/dovecot/sa-learn-pipe.sh >> >> ######################### >> >> config >> >> ### >> 90-plugin.conf >> >> plugin { >> #setting_name = value >> >> antispam_backend = pipe >> antispam_debug_target = syslog >> antispam_verbose_debug = 1 >> # antispam_mail_sendmail_args= --username=%u >> antispam_mail_spam_arg = --spam >> antispam_mail_notspam_arg = --ham >> antispam_mail_program = /etc/dovecot/sa-learn-pipe.sh >> antispam_spam = Spam;SPAM;z_SPAM >> antispam_trash = Trash;trash >> } >> >> ### >> >> sa-learn-pipe.sh >> >> #!/bin/bash >> set -x >> pid=$$ >> # remove the # from next line to background learner >> #( >> { >> echo "$(date) ${pid}-start ($*) /tmp/sendmail-msg-$$.txt" >> set -x >> #id -a >> #env >> >> cat > /tmp/sendmail-msg-${pid}.txt >> /usr/bin/sa-learn "$@" /tmp/sendmail-msg-${pid}.txt >> echo "$(date) $$-end rc=$?" >> } >/tmp/antispam.${pid}.log 2>&1 >> >> echo "cat antispam.${pid}.log" >> cat /tmp/antispam.${pid}.log >>/tmp/sa-learn-pipe.log >> rm -f /tmp/antispam.${pid}.log /tmp/sendmail-msg-${pid}.txt >> true >> # remove the # from next line to background learner >> #) & >> exit 0 >>
Apparently Analagous Threads
- dovecot-antispam plugin not work
- Need a bit of help with the antispam plugin
- plugin antispam sa-learn run program failed with exit code -1
- dovecot-antispam plugin and "Failed to call dspam" message
- plugin antispam sa-learn run program failed with exit code -1