]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Call mail_cache_close_mail() when mail is closed
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 18 Aug 2017 14:38:34 +0000 (17:38 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 21 Aug 2017 09:28:05 +0000 (12:28 +0300)
Fixes caching problems with INDEX=MEMORY

src/lib-storage/index/index-mail.c

index feca8fe98f43c46f91e45d88ff2e1a9d6a80f068..1d5c3d03adfc20c35fdff7d87d1ce2b34ab4e6b4 100644 (file)
@@ -1693,6 +1693,10 @@ void index_mail_close(struct mail *_mail)
        }
 
        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);