From: Timo Sirainen Date: Tue, 21 Oct 2003 03:35:43 +0000 (+0300) Subject: Don't save empty header lists X-Git-Tag: 1.1.alpha1~4273 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed6d301337be19bc06621b83134c5b330bab6339;p=thirdparty%2Fdovecot%2Fcore.git Don't save empty header lists --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/index-mail-headers.c b/src/lib-storage/index/index-mail-headers.c index 9dfbb03aee..184a960626 100644 --- a/src/lib-storage/index/index-mail-headers.c +++ b/src/lib-storage/index/index-mail-headers.c @@ -539,8 +539,12 @@ int index_mail_parse_headers(struct index_mail *mail) return FALSE; } - data->header_save = TRUE; - data->header_save_idx = idx; + /* it's possible that we're parsing headers without wanting + to save any of them */ + if (buffer_get_used_size(data->headers) != 0) { + data->header_save = TRUE; + data->header_save_idx = idx; + } } data->bodystructure_header_parse = data->bodystructure_header_want;