From: Timo Sirainen Date: Mon, 5 Jun 2017 17:14:54 +0000 (+0300) Subject: lib-storage: Make sure istream-mail doesn't replace an existing storage error X-Git-Tag: 2.3.0.rc1~1516 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=646800dd3bdf2992eadfbd4dac7a14dd729fe00b;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Make sure istream-mail doesn't replace an existing storage error I'm not aware of it actually having broken anything, so this is just for extra safety. --- diff --git a/src/lib-storage/index/istream-mail.c b/src/lib-storage/index/istream-mail.c index a5bfcfbda5..bc57500150 100644 --- a/src/lib-storage/index/istream-mail.c +++ b/src/lib-storage/index/istream-mail.c @@ -23,11 +23,15 @@ static bool i_stream_mail_try_get_cached_size(struct mail_istream *mstream) if (mstream->expected_size != (uoff_t)-1) return TRUE; + /* make sure this call doesn't change any existing error message, + just in case there's already something important in it. */ + mail_storage_last_error_push(mail->box->storage); orig_lookup_abort = mail->lookup_abort; mail->lookup_abort = MAIL_LOOKUP_ABORT_NOT_IN_CACHE; if (mail_get_physical_size(mail, &mstream->expected_size) < 0) mstream->expected_size = (uoff_t)-1; mail->lookup_abort = orig_lookup_abort; + mail_storage_last_error_pop(mail->box->storage); return mstream->expected_size != (uoff_t)-1; }