dovecot: mail_get_date(): Missing Date: header should be returne...

dovecot at dovecot.org dovecot at dovecot.org
Tue Oct 16 17:03:17 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/699c4c193ffc
changeset: 6545:699c4c193ffc
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Oct 16 17:02:50 2007 +0300
description:
mail_get_date(): Missing Date: header should be returned as 0, not as -1.

diffstat:

1 file changed, 3 insertions(+), 2 deletions(-)
src/lib-storage/index/index-mail.c |    5 +++--

diffs (17 lines):

diff -r 68c8a6ddde12 -r 699c4c193ffc src/lib-storage/index/index-mail.c
--- 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 @@ static int index_mail_cache_sent_date(st
 	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;


More information about the dovecot-cvs mailing list