Mercurial > dovecot > original-hg > dovecot-2.1
changeset 14604:8ef2b31b125f
pop3c: Don't get size of TOP output and cache it as message's virtual size.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 07 Jul 2012 16:27:59 +0300 |
parents | b3e1111e7f49 |
children | 01cdca5817f2 |
files | src/lib-storage/index/pop3c/pop3c-mail.c |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/pop3c/pop3c-mail.c Wed Jul 04 11:02:58 2012 +0300 +++ b/src/lib-storage/index/pop3c/pop3c-mail.c Sat Jul 07 16:27:59 2012 +0300 @@ -110,10 +110,12 @@ if (mail->data.stream == NULL) { capa = pop3c_client_get_capabilities(mbox->client); - if (get_body || (capa & POP3C_CAPABILITY_TOP) == 0) + if (get_body || (capa & POP3C_CAPABILITY_TOP) == 0) { cmd = t_strdup_printf("RETR %u\r\n", _mail->seq); - else + get_body = TRUE; + } else { cmd = t_strdup_printf("TOP %u 0\r\n", _mail->seq); + } if (pop3c_client_cmd_stream(mbox->client, cmd, &input, &error) < 0) { mail_storage_set_error(mbox->box.storage, @@ -130,7 +132,8 @@ } } i_stream_set_name(mail->data.stream, t_strcut(cmd, '\r')); - pop3c_mail_cache_size(mail); + if (get_body) + pop3c_mail_cache_size(mail); } return index_mail_init_stream(mail, hdr_size, body_size, stream_r); }