[Dovecot] zlib maildir reindex broken
I posted to the list about this a while ago but never got a response, I have a bit more information now.
Dovecot 2.2.12 and other 2.2 versions are broken when using zlib and maildir. If messages are re-indexed, the INTERNALDATE of all messages is set to the time the re-index is done.
The problem seems to be in src/plugins/zlib/zlib-plugin.c in the function zlib_mail_cache_open.
During a reindex maildir_mail_get_received_date() does an i_stream_stat on the the i_stream_seekable stream created in zlib_mail_cache_open, but this istream does not know about the original maildir message file and always returns the current time for the file's stat times.
This is also broken on initial index, but if mail is indexed when it's received (ours isn't) it coincidentally gets the right time.
On 24.4.2014, at 0.51, Richard Platel rplatel@tucows.com wrote:
I posted to the list about this a while ago but never got a response, I have a bit more information now.
Dovecot 2.2.12 and other 2.2 versions are broken when using zlib and maildir. If messages are re-indexed, the INTERNALDATE of all messages is set to the time the re-index is done.
The problem seems to be in src/plugins/zlib/zlib-plugin.c in the function zlib_mail_cache_open.
During a reindex maildir_mail_get_received_date() does an i_stream_stat on the the i_stream_seekable stream created in zlib_mail_cache_open, but this istream does not know about the original maildir message file and always returns the current time for the file's stat times.
This is also broken on initial index, but if mail is indexed when it's received (ours isn't) it coincidentally gets the right time.
Thanks, fixed: http://hg.dovecot.org/dovecot-2.2/rev/9f1460682295
Hey Timo,
On 02.05.2014 12:37, Timo Sirainen wrote:
During a reindex maildir_mail_get_received_date() does an i_stream_stat on the the i_stream_seekable stream created in zlib_mail_cache_open, but this istream does not know about the original maildir message file and always returns the current time for the file's stat times. This is also broken on initial index, but if mail is indexed when it's received (ours isn't) it coincidentally gets the right time.
Thanks, fixed: http://hg.dovecot.org/dovecot-2.2/rev/9f1460682295
It seems this is unfortunately also broken in 2.1.17.
If possible could you also provide a fix for the 2.1.x tree, as we are still happily running your code from that era. Your fix for 2.2 does sadly not apply without modifications and I don't want to destroy things with incompetent attempts to do production grade C coding ;-)
With regards from Cologne,
Christian
Am 03.07.2014 16:55, schrieb Christian Rohmann:
Hey Timo,
On 02.05.2014 12:37, Timo Sirainen wrote:
During a reindex maildir_mail_get_received_date() does an i_stream_stat on the the i_stream_seekable stream created in zlib_mail_cache_open, but this istream does not know about the original maildir message file and always returns the current time for the file's stat times. This is also broken on initial index, but if mail is indexed when it's received (ours isn't) it coincidentally gets the right time.
Thanks, fixed: http://hg.dovecot.org/dovecot-2.2/rev/9f1460682295
It seems this is unfortunately also broken in 2.1.17.
If possible could you also provide a fix for the 2.1.x tree, as we are still happily running your code from that era. Your fix for 2.2 does sadly not apply without modifications and I don't want to destroy things with incompetent attempts to do production grade C coding ;-)
With regards from Cologne,
Christian
I strongly vote for a 2.1.18 including such fix
Best Regards MfG Robert Schetterer
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
participants (4)
-
Christian Rohmann
-
Richard Platel
-
Robert Schetterer
-
Timo Sirainen