# HG changeset patch # User Timo Sirainen # Date 1503067114 -10800 # Node ID 6ad4c4203dbac2703bff6dbcf2ca4fe3ee0de154 # Parent a6f1f04b70e49a3aa0fb6e58af29bec53ab4fd4f lib-storage: Call mail_cache_close_mail() when mail is closed Fixes caching problems with INDEX=MEMORY diff -r a6f1f04b70e4 -r 6ad4c4203dba src/lib-storage/index/index-mail.c --- a/src/lib-storage/index/index-mail.c Fri Aug 18 17:34:14 2017 +0300 +++ b/src/lib-storage/index/index-mail.c Fri Aug 18 17:38:34 2017 +0300 @@ -1693,6 +1693,10 @@ } index_mail_close_streams_full(mail, TRUE); + /* Notify cache that the mail is no longer open. This mainly helps + with INDEX=MEMORY to keep all data added with mail_cache_add() in + memory until this point. */ + mail_cache_close_mail(_mail->transaction->cache_trans, _mail->seq); if (mail->data.wanted_headers != NULL) mailbox_header_lookup_unref(&mail->data.wanted_headers);