Learning ham/spam with IMAPSieve: sa-learn-ham.sh terminated abnormally, signal 11

Jens Rey it at rey.nrw
Sun Nov 17 01:51:47 EET 2019


Hello,

I am trying to get rspam to learn what is spam and what is ham.

After following the IMAPSieve guide in the dovecot wiki 
(https://wiki2.dovecot.org/HowTo/AntispamWithSieve), the mail.log shows 
the following, whenever I move a mail from the Spam folder to my inbox 
and vice versa:

sieve: Opening script 1 of 1 from `/usr/lib/dovecot/sieve/report-ham.sieve'
sieve: Loading script /usr/lib/dovecot/sieve/report-ham.sieve
sieve: Script binary /usr/lib/dovecot/sieve/report-ham.svbin 
successfully loaded
sieve: binary save: not saving binary 
/usr/lib/dovecot/sieve/report-ham.svbin, because it is already stored
sieve: Executing script from `/usr/lib/dovecot/sieve/report-ham.svbin'
sieve: action pipe: running program: sa-learn-ham.sh
Mailbox INBOX: Opened mail UID=2996 because: mail stream
Debug: waiting for program `/usr/lib/dovecot/sieve/sa-learn-ham.sh' to 
finish after 0 msecs
Error: program `/usr/lib/dovecot/sieve/sa-learn-ham.sh' terminated 
abnormally, signal 11
Error: sieve: pipe action: failed to pipe message to program 
`sa-learn-ham.sh': refer to server log for more information. [2019-11-17 
00:39:33]
Error: sieve: Execution of script 
/usr/lib/dovecot/sieve/report-ham.sieve failed


My relevant dovecot configuration:

plugin {
   imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
   imapsieve_mailbox1_causes = COPY
   imapsieve_mailbox1_name = Spam
   imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
   imapsieve_mailbox2_causes = COPY
   imapsieve_mailbox2_from = Spam
   imapsieve_mailbox2_name = *

   sieve = 
file:/var/vmail/sieve/%d/%n/scripts;active=/var/vmail/sieve/%d/%n/active-script.sieve
   sieve_before = /var/vmail/sieve/global/spam-global.sieve
   sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
   sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
   sieve_plugins = sieve_imapsieve sieve_extprograms
}

$ dovecot --version
2.2.27 (c0f36b0)

$ ls -l /usr/lib/dovecot/sieve/
total 24
-rw-r--r-- 1 root root 314 Nov 17 00:25 report-ham.sieve
-rw-r--r-- 1 root root 448 Nov 17 00:30 report-ham.svbin
-rw-r--r-- 1 root root 199 Nov 17 00:25 report-spam.sieve
-rw-r--r-- 1 root root 354 Nov 17 00:30 report-spam.svbin
-rwxr-xr-x 1 root root  41 Nov 17 00:32 sa-learn-ham.sh
-rwxr-xr-x 1 root root  42 Nov 17 00:32 sa-learn-spam.sh

$ cat sa-learn-ham.sh
#!/bin/sh
exec /usr/bin/rspamc learn_ham


When I execute the script manually, it seems to work:
$ cat [some-mail] | /usr/lib/dovecot/sieve/sa-learn-ham.sh
Results for file: stdin (0.011 seconds)
success = true;
filename = "stdin";
scan_time = 0.012000;

Again, with the same mail:
$ cat [some-mail] | /usr/lib/dovecot/sieve/sa-learn-ham.sh
Results for file: stdin (0.000 seconds)
error = "<some-mail> has been already learned as ham, ignore it";
filename = "stdin";
scan_time = 0.0;

Any ideas what causes the abnormal temrination of the script?

Regards,
Jens


More information about the dovecot mailing list