Bug 257208 - mail/dovecot 2.3.15 and mail/dovecot-pigeonhole: Error: zlib_save: Support not compiled in for handler: xz
Summary: mail/dovecot 2.3.15 and mail/dovecot-pigeonhole: Error: zlib_save: Support no...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Larry Rosenman
Keywords: needs-qa, regression
Depends on:
Reported: 2021-07-15 14:56 UTC by Mohammad S. Babaei
Modified: 2021-07-17 18:46 UTC (History)
2 users (show)

See Also:
linimon: maintainer-feedback? (ler)
koobs: maintainer-feedback? (pi)
koobs: merge-quarterly?


Note You need to log in before you can comment on or make changes to this bug.
Description Mohammad S. Babaei 2021-07-15 14:56:16 UTC
After upgrading my ports I receive the following inside my maillog and I cannot retrieve any emails:

Jul 15 14:36:14 core dovecot[9207]: imap(someemail@somedomain.com)<87605><IlafZCrHndle7WyY>: Error: zlib_save: Support not compiled in for handler: xz
Jul 15 14:36:14 core dovecot[9207]: imap(someemail@somedomain.com)<87605><IlafZCrHndle7WyY>: Fatal: master: service(imap): child 87605 killed with signal 11 (core not dumped - https://dovecot.org/bugreport.html#coredumps - set service imap { drop_priv_before_exec=yes })
Jul 15 14:36:14 core dovecot[9207]: imap-login: Login: user=<someemail@somedomain.com>, method=PLAIN, rip=XXX.XXX.XXX.XXX, lip=XXX.XXX.XXX.XXX, mpid=88224, TLS, session=<geGgZCrHntle7WyY>

No changes to the config files or the port use flags. However, if I downgrade using the following commands to 2.3.13 there's no error anymore:

$ cd /usr/ports/mail/dovecot
$ git checkout 69d24a727d44d398f7357cb844386f3ec4750a4f .
$ make reinstall clean DISABLE_VULNERABILITIES=yes
$ cd /usr/ports/mail/dovecot-pigeonhole
$ git checkout 305f148f482daf30dcf728039d03d019f88344eb .
$ make reinstall clean DISABLE_VULNERABILITIES=yes
$ service dovecot restart
$ tail -f /var/log/maillogs

And, voila! There are no errors and it works as expected. For now I did

$ pkg lock mail/dovecot
$ pkg lock mail/dovecot-pigeonhole
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2021-07-15 16:15:06 UTC
^Triage: edit Summary and assign.
Comment 2 Kurt Jaeger freebsd_committer 2021-07-17 07:42:03 UTC
(In reply to Mohammad S. Babaei from comment #0)

The ChangeLog mentions this:

2021-01-22 14:00:21 -0500 Josef 'Jeff' Sipek <jeff.sipek@open-xchange.com> (6e5ae5ef0f)

    lib-compression: Remove xz/lzma write support

    For now, we keep the read support to allow for a more gradual migration from 

    The code has bugs.  Additionally, there is no benefit in keeping it around. 
    bzip2 or zstd (at maximum compression level) are likely better choices for 
    archival.  For non-archival usecases, a light compression algorithm like 
    zstd (at low to medium compression level) or lz4 are better choices.
Comment 3 Mohammad S. Babaei 2021-07-17 18:29:00 UTC
Thank you very much!

I appreciate it if you'd let me know, how can I convert my mailboxes?
Comment 4 Kurt Jaeger freebsd_committer 2021-07-17 18:40:25 UTC
(In reply to Mohammad S. Babaei from comment #3)
I don't know either. I suggest to ask on the dovecot mailing list, as you are probably not the only one hit by this.


And btw, the relnotes mention that only write-support is disabled,
so maybe xz files can still be read by dovecot ?
Comment 5 Mohammad S. Babaei 2021-07-17 18:42:57 UTC
Thank you! I've figured it out. I rebuilt dovecot with LZ4 support and then made the following modification and restarted the server. It works fine now. Although the documentation does not mention which levels are valid for lz4 https://doc.dovecot.org/configuration_manual/zlib_plugin/

-  zlib_save = xz
-  zlib_save_level = 6
+  zlib_save = lz4
+  # You can use per-algorithm compression levels, and defaults. Prior to
+  # v2.3.15, the compression level must be an integer in the range 1 to 9
+  # regardless of the algorithm selected. The default level is 6. These
+  # values may not make sense with compression algorithms other than gz
+  # and bz2. For example, zstd supports levels from -1 to 22 in latest
+  # Zstandard version.
+  #zlib_save_level = 6
Comment 6 Mohammad S. Babaei 2021-07-17 18:46:51 UTC
OK, it seems it's between 1-12. https://www.mankier.com/1/lz4