Skip to content

Commit

Permalink
imapc: Update mail size also when istream_opened() hook is called
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirainen authored and villesavolainen committed Mar 20, 2018
1 parent 3e65692 commit 44afc06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib-storage/index/imapc/imapc-mail-fetch.c
Expand Up @@ -576,7 +576,8 @@ void imapc_mail_init_stream(struct imapc_mail *mail)
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);
Expand Down

0 comments on commit 44afc06

Please sign in to comment.