From: Timo Sirainen Date: Thu, 26 Jun 2003 00:48:31 +0000 (+0300) Subject: Don't send \Unmarked in LIST reply unless mbox file is zero-sized. We can't X-Git-Tag: 1.1.alpha1~4525 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f24649e4eddb2379be040f1eeed572ddbdb00556;p=thirdparty%2Fdovecot%2Fcore.git Don't send \Unmarked in LIST reply unless mbox file is zero-sized. We can't get it right with atime checks, so don't even try. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/mbox/mbox-list.c b/src/lib-storage/index/mbox/mbox-list.c index 0e88bbcb97..93fa55d3f1 100644 --- a/src/lib-storage/index/mbox/mbox-list.c +++ b/src/lib-storage/index/mbox/mbox-list.c @@ -11,9 +11,13 @@ #include #include +/* atime < mtime is a reliable way to know that something changed in the file. + atime >= mtime is not however reliable, especially because atime gets + updated whenever we open the mbox file, and STATUS/EXAMINE shouldn't change + \Marked mailbox to \Unmarked.. */ #define STAT_GET_MARKED(st) \ - ((st).st_size != 0 && (st).st_atime < (st).st_ctime ? \ - MAILBOX_MARKED : MAILBOX_UNMARKED) + ((st).st_size == 0 ? MAILBOX_UNMARKED : \ + (st).st_atime < (st).st_mtime ? MAILBOX_MARKED : 0) struct list_dir_context { struct list_dir_context *prev;