<div dir="ltr"><div>Hi there ! <br></div><div><br></div><div>I´m using dovecot 2.3.10 (manually compiled on Centos 8 x86_64 - fully updated), XFS filesystem,  with mdbox and a separated compressed attachment directory: <br></div><div><br></div><div>mail_attachment_fs = sis compress:lz4:6:posix <br></div><div><br></div><div>mail_attachment_hash = %{sha256}</div><div><br></div><div>mail_attachment_dir = /ATTACHMENTS</div><div><br></div><div>I'm using dovecot LDA (for mail delivery). Everything works fine with the delivery and compression. The first test, I send one tar file with 7Mb. It was correctly compressed (2791959) and stored in mail_attachment_dir. But when I tried to access it via IMAP ( thunderbird/evolution) I got this message on dovecot logs:</div><div><br></div><div>Error: Mailbox INBOX: UID=1: read(attachments-connector(zlib(/mailboxes/domain/h1/h2/test/mdbox/storage/m.1))) failed: read(/ATTACHMENTS/19/53/19536d7b190e5ba68337625a29e7b8a6129a2dfb5935eafa424ba4da2a878532-2e9c960b7dd2985e245e0000f484007a[base64:19 b/l]) failed: Stream is smaller than expected (2791959 < 7981633) (FETCH BODY[])</div><div><br></div><div>The 7981633 is the original attachment size. 2791959 is the compressed size (on attachment directory). I also see 2791959 in mail message size field (instead of 7981633 that is the original size BEFORE compression) in Thunderbird. <br></div><div><br></div><div>In Evolution was not even possible to open the message. Thunderbird allow me even download the attachment, but the downloaded file is corrupted. <br></div><div><br></div><div>Looks like dovecot is showing the properties of the compressed attachment instead of the proprerties of the original attachment (before compression). <br></div><div><br></div><div>I'm also using imap_zlib and zlib plugins: <br></div><div><br></div><div>plugin {<br>  zlib_save_level = 6 # 1..9; default is 6<br>  zlib_save = lz4 # or bz2, xz, lz4 or zstd<br>}</div><div><br></div><div>protocol imap {<br>  # Space separated list of plugins to load (default is global mail_plugins).<br>  mail_plugins = $mail_plugins imap_quota imap_zlib<br>}<br></div><div><br></div><div># Space separated list of plugins to load for all services. Plugins specific to<br># IMAP, LDA, etc. are added to this list in their own .conf files.<br>mail_plugins = quota fts fts_xapian mailbox_alias zlib</div><div><br></div><div>This happens with every message that exceed mail_attachment_min_size  (in my case, 32k) and is stored at mail_attachment_dir = /ATTACHMENTS</div><div><br></div><div>When I comment: mail_attachment_dir = /ATTACHMENTS, everything works fine (compression included) with imap viewing on Thunderbird/Evolution.  <br></div><div><br></div><div>Please, let me know if you need further information or have any suggestions about this issue. <br></div><div><br></div><div>TIA,<br></div><div><br></div><div>Claudio<br></div></div>