]> 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)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 21 Aug 2017 06:36:00 +0000 (09:36 +0300)
Fixes caching problems with INDEX=MEMORY

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

index d0c954c8699d54013cf2644ddebdd6b14335807c..be4df61a317561dc7071f1075b0a4a9bbed63a01 100644 (file)
@@ -1696,6 +1696,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);