]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: mail_get_*header*() were unnecessarily looking up the headers twice.
authorTimo Sirainen <tss@iki.fi>
Wed, 20 Nov 2013 12:38:55 +0000 (14:38 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 20 Nov 2013 12:38:55 +0000 (14:38 +0200)
src/lib-storage/index/index-mail-headers.c

index 6b075b30f7f77f4c65191bd5bb16db867cb675f3..75c452cd520eb10b3d8e6eef0d03c5e5b6131c66 100644 (file)
@@ -760,6 +760,9 @@ int index_mail_get_headers(struct mail *_mail, const char *field,
                        mail_cache_set_corrupted(_mail->box->cache,
                                "Broken header %s for mail UID %u",
                                field, _mail->uid);
+                       /* retry by parsing the full header */
+               } else {
+                       break;
                }
        }
        return ret;
@@ -788,6 +791,9 @@ int index_mail_get_first_header(struct mail *_mail, const char *field,
                        mail_cache_set_corrupted(_mail->box->cache,
                                "Broken header %s for mail UID %u",
                                field, _mail->uid);
+                       /* retry by parsing the full header */
+               } else {
+                       break;
                }
        }
        *value_r = list[0];