[Dovecot] Possible programming error in maildir_mail_get_save_date

Rainer Weikusat rweikusat at mssgmbh.com
Sun Mar 21 23:22:28 EET 2010


The maildir_mail_gate_save_date routine
(lib-storage/index/maildir/maildir-mail.c) returns the save date when
that was determined by looking at the ctime of the corresponding
file. This is different from all other get_save_date routines which
either return -1 if the date could not be determined or 0 to signal
success. A particular problem caused by this would be that the
first_nonexpunged_timestamp routine (plugins/expire/expire-plugin)
never finds a not-yet-expired e-mail after the first message in a
mailbox has been expunged when using the maildir storage and file
ctimes for save dates, causing the expire_mailbox_transaction_commit
function (same file) to delete expiry information for the mailbox in
question from the expires table despite mails supposed to expire still
exist.

Patch below is against 1.2.11.

-----
Index: dovecot/src/lib-storage/index/maildir/maildir-mail.c
===================================================================
RCS file: /sysdata/cvs/dovecot/src/lib-storage/index/maildir/maildir-mail.c,v
retrieving revision 1.1.1.2
retrieving revision 1.1.1.2.2.1
diff -u -r1.1.1.2 -r1.1.1.2.2.1
--- dovecot/src/lib-storage/index/maildir/maildir-mail.c	15 Mar 2010 18:18:14 -0000	1.1.1.2
+++ dovecot/src/lib-storage/index/maildir/maildir-mail.c	19 Mar 2010 22:33:44 -0000	1.1.1.2.2.1
@@ -154,7 +154,7 @@
 		return -1;
 
 	*date_r = data->save_date = st.st_ctime;
-	return data->save_date;
+	return 0;
 }
 
 static int



More information about the dovecot mailing list