Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7332:3f9f01913f90 HEAD
If dbox file doesn't have sent date, return (and cache) current time.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 04 Mar 2008 06:23:45 +0200 |
parents | 9ef06104648a |
children | cd22f3bcd29d |
files | src/lib-storage/index/dbox/dbox-mail.c |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ 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; }