Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6545:699c4c193ffc HEAD
mail_get_date(): Missing Date: header should be returned as 0, not as -1.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 16 Oct 2007 17:02:50 +0300 |
parents | 68c8a6ddde12 |
children | a53bc41fade4 |
files | src/lib-storage/index/index-mail.c |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/index-mail.c Tue Oct 09 22:48:09 2007 +0300 +++ b/src/lib-storage/index/index-mail.c Tue Oct 16 17:02:50 2007 +0300 @@ -226,10 +226,11 @@ if (data->sent_date.time != (uint32_t)-1) return 0; - if ((ret = mail_get_first_header(&mail->mail.mail, "Date", &str)) <= 0) + if ((ret = mail_get_first_header(&mail->mail.mail, "Date", &str)) < 0) return ret; - if (!message_date_parse((const unsigned char *)str, + if (ret == 0 || + !message_date_parse((const unsigned char *)str, strlen(str), &t, &tz)) { /* 0 = not found / invalid */ t = 0;