dovecot-1.1: If dbox file doesn't have sent date, return (and ca...

dovecot at dovecot.org dovecot at dovecot.org
Tue Mar 4 06:28:08 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/3f9f01913f90
changeset: 7332:3f9f01913f90
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Mar 04 06:23:45 2008 +0200
description:
If dbox file doesn't have sent date, return (and cache) current time.

diffstat:

1 file changed, 4 insertions(+), 1 deletion(-)
src/lib-storage/index/dbox/dbox-mail.c |    5 ++++-

diffs (22 lines):

diff -r 9ef06104648a -r 3f9f01913f90 src/lib-storage/index/dbox/dbox-mail.c
--- a/src/lib-storage/index/dbox/dbox-mail.c	Tue Mar 04 04:07:32 2008 +0200
+++ b/src/lib-storage/index/dbox/dbox-mail.c	Tue Mar 04 06:23:45 2008 +0200
@@ -1,6 +1,7 @@
 /* Copyright (c) 2007-2008 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
+#include "ioloop.h"
 #include "istream.h"
 #include "index-mail.h"
 #include "dbox-storage.h"
@@ -119,7 +120,9 @@ static int dbox_mail_get_save_date(struc
 
 	value = dbox_file_metadata_get(file, DBOX_METADATA_SAVE_TIME);
 	data->save_date = value == NULL ? 0 : strtoul(value, NULL, 16);
-	*date_r = data->save_date;
+	/* if the time is missing or corrupted, use the current time and
+	   cache it */
+	*date_r = data->save_date == 0 ? ioloop_time : data->save_date;
 	return 0;
 }
 


More information about the dovecot-cvs mailing list