pigeonhole 0.4.22 with sieve_before script crashes

Jan lists at wessel-nienburg.de
Sat Mar 3 03:57:41 EET 2018


Hello!

Dovecot 2.2.34 (874deae)
Pigeonhole version 0.4.22 (22940fb7)

After the update to pigeonhole version 0.4.22 the following
configuration does not work. With version 0.4.21 it works.

dovecot.conf (only sieve configuration)
---------------------------------------------------------------
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 index ihave duplicate mime foreverypart 
extracttext editheader
sieve = file:~/sieve;active=~/.dovecot.sieve
sieve_before = /etc/dovecot/sieve/filter
sieve_extensions = +editheader
sieve_max_script_size = 1M
service managesieve-login {
   inet_listener sieve {
     port = 4190
   }
}
protocol sieve {
   mail_max_userip_connections = 10
   managesieve_implementation_string = Sieve
   managesieve_logout_format = bytes=%i/%o
}
---------------------------------------------------------------

sieve_before script for all users (/etc/dovecot/sieve/filter)
---------------------------------------------------------------
require ["editheader"];

if header :contains "X-Spam-Flag" "YES" {
   addheader "X-Filter-Junk-Flag" "YES";
   addheader "X-Filter-Junk-Type" "SPAM";
}
elsif header :contains "X-Amavis-Alert" "INFECTED" {
   addheader "X-Filter-Junk-Flag" "YES";
   addheader "X-Filter-Junk-Type" "VIRUS";
}
elsif header :contains "X-Amavis-Alert" "BANNED" {
   addheader "X-Filter-Junk-Flag" "YES";
   addheader "X-Filter-Junk-Type" "ATTACHMENT";
}
else {
   addheader "X-Filter-Junk-Flag" "NO";
   addheader "X-Filter-Junk-Type" "NONE";
}
---------------------------------------------------------------

sieve script for user postbox at example.com (.dovecot.sieve)
---------------------------------------------------------------
require ["copy"];
if allof (header :is "X-Filter-Junk-Flag" "NO")
{
   redirect :copy "copy at example.com";
}
---------------------------------------------------------------

I use LMTP to deliver the mail to the user and the
following error occurs:

Mar  3 02:31:34 test dovecot: lmtp(postbox at example.com): Panic: file 
istream.c: line 197 (i_stream_read): assertion failed: 
((size_t)ret+old_size == _stream->pos - _stream->skip)
Mar  3 02:31:34 test dovecot: lmtp(postbox at example.com): Error: Raw 
backtrace: /usr/local/lib/dovecot/libdovecot.so.0(+0x9c7a0) 
[0x7f8c015be7a0] -> /usr/local/lib/dovecot/libdovecot.so.0(+0x9c88c) 
[0x7f8c015be88c] -> /usr/local/lib/dovecot/libdovecot.so.0(i_fatal+0) 
[0x7f8c0155294d] -> 
/usr/local/lib/dovecot/libdovecot.so.0(i_stream_read+0x2c8) 
[0x7f8c015c99d8] -> 
/usr/local/lib/dovecot/libdovecot.so.0(i_stream_read_data+0x3d) 
[0x7f8c015ca15d] -> 
/usr/local/lib/dovecot/libdovecot.so.0(message_parse_header_next+0x63) 
[0x7f8c015a72e3] -> /usr/local/lib/dovecot/libdovecot.so.0(+0x7efb1) 
[0x7f8c015a0fb1] -> 
/usr/local/lib/dovecot/libdovecot.so.0(i_stream_read+0x53) 
[0x7f8c015c9763] -> 
/usr/local/lib/dovecot/libdovecot.so.0(i_stream_read_data+0x3d) 
[0x7f8c015ca15d] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_stream_copy+0x75) 
[0x7f8c015df1a5] -> /usr/local/lib/dovecot/libdovecot.so.0(+0xbf5e0) 
[0x7f8c015e15e0] -> 
/usr/local/lib/dovecot/libdovecot.so.0(o_stream_send_istream+0x33) 
[0x7f8c015df003] -> 
/usr/local/lib/dovecot/libdovecot-sieve.so.0(+0x4dbf4) [0x7f8bfbb3abf4] 
-> /usr/local/lib/dovecot/libdovecot-sieve.so.0(+0x3f22a) 
[0x7f8bfbb2c22a] -> 
/usr/local/lib/dovecot/libdovecot-sieve.so.0(sieve_result_execute+0x27f) 
[0x7f8bfbb2da6f] -> 
/usr/local/lib/dovecot/libdovecot-sieve.so.0(+0x502ee) [0x7f8bfbb3d2ee] 
-> 
/usr/local/lib/dovecot/libdovecot-sieve.so.0(sieve_multiscript_run+0xa6) 
[0x7f8bfbb3def6] -> 
/usr/local/lib/dovecot/lib90_sieve_plugin.so(+0x379a) [0x7f8bfbda279a] 
-> /usr/local/lib/dovecot/libdovecot-lda.so.0(mail_deliver+0xa2) 
[0x7f8c01b9d942] -> dovecot/lmtp [DATA 127.0.0.1 postbox at example.com]() 
[0x406c0b] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x52) 
[0x7f8c015d3c22] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xea) 
[0x7f8c015d51ca] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x3c) 
[0x7f8c015d3cbc] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_loop_run+0x38) 
[0x7f8c015d3e68] -> 
/usr/local/lib/dovecot/libdovecot.so.0(master_service_run+0x13) 
[0x7f8c0155caa3] -> dovecot/lmtp [DATA 127.0.0.1 
postbox at example.com](main+0x18c) [0x404fbc] -> 
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f8c01198b45] 
-> dovecot/lmtp [DATA 127.0.0.1 postbox at example.com]() [0x405065]
Mar  3 02:31:34 test dovecot: lmtp(postbox at example.com): Fatal: master: 
service(lmtp): child 13445 killed with signal 6 (core dumps disabled)

If I change the sieve script for this user, it works.
For example:
---------------------------------------------------------------
require ["copy"];
if allof (header :is "X-Filter-Junk-Status" "NO")
{
   redirect :copy "copy at example.com";
}
---------------------------------------------------------------

The error occurs only in version 0.4.22, not in version 0.4.21.

Thanks,
Jan


More information about the dovecot mailing list