When fetching a message body the cached message size was set. However,
if istream_opened() hook was used this wasn't done. If a client had
fetched both (RFC822.SIZE BODY.PEEK[]) and the server sent a wrong
RFC822.SIZE, that size was used for the message body size, which resulted
in "Cached message size larger than expected" errors.
index_mail_close_streams(imail);
return;
}
- } else if (mail->body_fetched) {
+ }
+ if (mail->body_fetched) {
ret = i_stream_get_size(imail->data.stream, TRUE, &size);
if (ret < 0) {
index_mail_close_streams(imail);