Package: dovecot-core Version: 1:2.3.4.1-5 Severity: important Tags: upstream
Hi, My mail service is configured with archive folders using gzipped mailboxes for storage. After upgrading from stretch to buster, folders that are gzipped mbox with more than one message cannot be opened if they need to be indexed. Folders with valid indexes still open fine, and an mbox that fails to open can be opened by mutt, or opened by dovecot if decompressed, and returns to failing when compressed again. I tried to isolate the problem and found it only appears on mboxes with more than one message. It also fails the same way for any compression format supported by the zlib plugin. I pulled an mbox extract from another dovecot bug report in order to test with an mbox from another source. The error message is below: # doveadm -v index -u mhoward Archive.test-bug doveadm(mhoward): Info: Archive.test-bug: Caching mails seq=1..5 5/5 # gzip ~mhoward/archive/mboxes/.test-bug # doveadm -v index -u mhoward Archive.test-bug.gz doveadm(mhoward): Error: Next message unexpectedly corrupted in mbox file /home/mhoward/archive/mboxes/.test-bug.gz at 6821 doveadm(mhoward): Error: Unexpectedly lost From-line from mbox file /home/mhoward/archive/mboxes/.test-bug.gz at 6821 doveadm(mhoward): Panic: file mbox-sync.c: line 1333 (mbox_sync_handle_eof_updates): assertion failed: (trailer_size <= 2) doveadm(mhoward): Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(+0xd0e7a) [0xb7c6be7a] -> /usr/lib/dovecot/libdovecot.so.0(+0xd0ec4) [0xb7c6bec4] -> /usr/lib/dovecot/libdovecot.so.0(+0x392b3) [0xb7bd42b3] -> /usr/lib/dovecot/libdovecot-storage.so.0(+0x30785) [0xb7d86785] -> /usr/lib/dovecot/libdovecot-storage.so.0(mbox_sync+0x53) [0xb7de4283] -> /usr/lib/dovecot/libdovecot-storage.so.0(mbox_storage_sync_init+0x6f) [0xb7de43cf] -> /usr/lib/dovecot/libdovecot-storage.so.0(mailbox_sync_init+0x5a) [0xb7da04fa] -> /usr/lib/dovecot/libdovecot-storage.so.0(mailbox_sync+0x42) [0xb7da05c2] -> doveadm(+0x2e0b6) [0x4920b6] -> doveadm(+0x27e58) [0x48be58] -> doveadm(+0x28b41) [0x48cb41] -> doveadm(doveadm_cmd_ver2_to_mail_cmd_wrapper+0x21e) [0x48da5e] -> doveadm(doveadm_cmd_run_ver2+0x487) [0x49f1f7] -> doveadm(doveadm_cmd_try_run_ver2+0x43) [0x49f293] -> doveadm(main+0x247) [0x47bf07] -> /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf1) [0xb7865b41] -> doveadm(_start+0x31) [0x47c3d1] Aborted # gunzip ~mhoward/archive/mboxes/.test-bug.gz && rm ~mhoward/archive/index/.test-bug/dovecot.index.* # doveadm -v index -u mhoward Archive.test-bug doveadm(mhoward): Info: Archive.test-bug: Caching mails seq=1..5 5/5 Rather than attach the `test-bug` mbox, this is the link it came from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879805;mbox=yes I think some sort of byte position accounting is off when dealing with compressed mboxes now. It aborts at the assertion, but there are corruption warnings before that - but the file is obviously not corrupt, and, assuming 6821 is a byte position, it's in the body of the first message, in the middle of a line. -- Package-specific info: dovecot configuration --------------------- # 2.3.4.1 (f79e8e7e4): /etc/dovecot/dovecot.conf # Pigeonhole version 0.5.4 () # OS: Linux 4.19.0-5-686-pae i686 Debian 10.0 auth_mechanisms = plain login lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes mail_location = maildir:~/Maildir mail_plugins = " virtual zlib" mail_privileged_group = mail namespace inbox { inbox = yes location = mailbox Drafts { auto = create special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Spam { auto = create special_use = \Junk } mailbox Trash { auto = create special_use = \Trash } prefix = } namespace mboxarchive { ignore_on_failure = no list = yes location = mbox:~/archive/mboxes:LAYOUT=maildir++:INDEX=~/archive/index:CONTROL=~/archive/control prefix = Archive. separator = . subscriptions = yes type = private } namespace virtual { location = virtual:~/Maildir/virtual mailbox Mailbox { special_use = \All } prefix = Virtual. separator = . type = private } passdb { driver = pam } plugin { quota = fs:User quota sieve = file:~/sieve;active=~/.dovecot.sieve sieve_before = /etc/dovecot/sieve/spam.sieve } protocols = imap quota_full_tempfail = yes service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } } ssl_cert = </var/lib/acme/live/cert ssl_client_ca_dir = /etc/ssl/certs ssl_dh = # hidden, use -P to show it ssl_key = # hidden, use -P to show it ssl_min_protocol = TLSv1.1 submission_max_mail_size = 4 G userdb { driver = passwd } protocol lda { mail_plugins = " virtual zlib sieve" } protocol imap { mail_plugins = " virtual zlib imap_zlib" } -- System Information: Debian Release: 10.0 APT prefers stable APT policy: (500, 'stable') Architecture: i386 (i686) Kernel: Linux 4.19.0-5-686-pae (SMP w/1 CPU core) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages dovecot-core depends on: ii adduser 3.118 ii libapparmor1 2.13.2-10 ii libbz2-1.0 1.0.6-9.1 ii libc6 2.28-10 ii libexttextcat-2.0-0 3.4.5-1 ii libicu63 63.1-6 ii liblua5.3-0 5.3.3-1.1 ii liblz4-1 1.8.3-1 ii liblzma5 5.2.4-1 ii libpam-runtime 1.3.1-5 ii libpam0g 1.3.1-5 ii libsodium23 1.0.17-1 ii libssl1.1 1.1.1c-1 ii libstemmer0d 0+svn585-1+b2 ii libwrap0 7.6.q-28 ii lsb-base 10.2019051400 ii openssl 1.1.1c-1 ii ssl-cert 1.0.39 ii ucf 3.0038+nmu1 ii zlib1g 1:1.2.11.dfsg-1 dovecot-core recommends no packages. Versions of packages dovecot-core suggests: ii dovecot-gssapi 1:2.3.4.1-5 ii dovecot-imapd 1:2.3.4.1-5 ii dovecot-ldap 1:2.3.4.1-5 pn dovecot-lmtpd <none> pn dovecot-lucene <none> pn dovecot-managesieved <none> ii dovecot-mysql 1:2.3.4.1-5 ii dovecot-pgsql 1:2.3.4.1-5 ii dovecot-pop3d 1:2.3.4.1-5 ii dovecot-sieve 1:2.3.4.1-5 pn dovecot-solr <none> ii dovecot-sqlite 1:2.3.4.1-5 pn dovecot-submissiond <none> pn ntp <none> Versions of packages dovecot-core is related to: ii dovecot-core [dovecot-common] 1:2.3.4.1-5 pn dovecot-dev <none> ii dovecot-gssapi 1:2.3.4.1-5 ii dovecot-imapd 1:2.3.4.1-5 ii dovecot-ldap 1:2.3.4.1-5 pn dovecot-lmtpd <none> pn dovecot-managesieved <none> ii dovecot-mysql 1:2.3.4.1-5 ii dovecot-pgsql 1:2.3.4.1-5 ii dovecot-pop3d 1:2.3.4.1-5 ii dovecot-sieve 1:2.3.4.1-5 ii dovecot-sqlite 1:2.3.4.1-5 -- debconf-show failed