From: Timo Sirainen Date: Wed, 13 Jul 2016 19:07:02 +0000 (-0500) Subject: lib-storage: Initialize pop3-uidl header also when no backend UIDLs exist. X-Git-Tag: 2.2.26~480 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12f9b06fb042820bcd5aa77776ccfff030d77aae;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Initialize pop3-uidl header also when no backend UIDLs exist. The first time POP3 UIDL command is used, set the header even when there are no backend UIDLs to prevent any further UIDL caching. --- diff --git a/src/lib-storage/index/index-pop3-uidl.c b/src/lib-storage/index/index-pop3-uidl.c index 5ebc7073ff..b5c8e0195d 100644 --- a/src/lib-storage/index/index-pop3-uidl.c +++ b/src/lib-storage/index/index-pop3-uidl.c @@ -65,8 +65,13 @@ void index_pop3_uidl_update_exists_finish(struct mailbox_transaction_context *tr size_t size; bool seen_all_msgs; - if (trans->highest_pop3_uidl_uid == 0) + mail_index_get_header_ext(trans->view, trans->box->pop3_uidl_hdr_ext_id, + &data, &size); + + if (trans->highest_pop3_uidl_uid == 0 && size >= sizeof(uidl)) { + /* header already set and nothing to change */ return; + } /* First check that we actually looked at UIDL for all messages. Otherwise we can't say for sure if the newest messages had UIDLs. */ @@ -89,8 +94,6 @@ void index_pop3_uidl_update_exists_finish(struct mailbox_transaction_context *tr return; /* check if we have already the same header */ - mail_index_get_header_ext(trans->view, trans->box->pop3_uidl_hdr_ext_id, - &data, &size); if (size >= sizeof(uidl)) { memcpy(&uidl, data, size); if (trans->highest_pop3_uidl_uid == uidl.max_uid_with_pop3_uidl)