On Tue, 2008-06-03 at 17:28 +0200, Anders wrote:
> I have not been able to reproduce this at will, but do see 1-Jan-1970 in
> rawlog about two times every day now (with some 80 accounts and probably
> thousands of deliveries).

Could you try with the attached debug patch? What does it log when it
happens?

diff -r e043135e971d src/lib-storage/index/maildir/maildir-mail.c
--- a/src/lib-storage/index/maildir/maildir-mail.c	Tue Jun 03 16:04:32 2008 +0300
+++ b/src/lib-storage/index/maildir/maildir-mail.c	Tue Jun 03 18:54:27 2008 +0300
@@ -116,8 +116,10 @@
 	if (index_mail_get_received_date(_mail, date_r) == 0)
 		return 0;
 
-	if (maildir_mail_stat(_mail, &st) < 0)
+	if (maildir_mail_stat(_mail, &st) < 0) {
+		i_warning("received date lookup failed");
 		return -1;
+	}
 
 	*date_r = data->received_date = st.st_mtime;
 	return 0;
diff -r e043135e971d src/lib-storage/index/maildir/maildir-uidlist.c
--- a/src/lib-storage/index/maildir/maildir-uidlist.c	Tue Jun 03 16:04:32 2008 +0300
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c	Tue Jun 03 18:54:27 2008 +0300
@@ -831,6 +831,7 @@
 		       enum maildir_uidlist_rec_flag *flags_r)
 {
 	const char *fname;
+	bool refresh = FALSE;
 
 	fname = maildir_uidlist_lookup_nosync(uidlist, uid, flags_r);
 	if (fname == NULL) {
@@ -839,6 +840,7 @@
 			   after the last mailbox sync */
 			if (maildir_uidlist_refresh(uidlist) < 0)
 				return NULL;
+			refresh = TRUE;
 		} else {
 			/* the uidlist doesn't exist. */
 			if (maildir_storage_sync_force(uidlist->mbox, uid) < 0)
@@ -847,6 +849,8 @@
 
 		/* try again */
 		fname = maildir_uidlist_lookup_nosync(uidlist, uid, flags_r);
+		i_warning("uidlist: uid=%u not found, refreshed=%d, again=%s",
+			  uid, refresh, fname == NULL ? "" : fname);
 	}
 
 	return fname;
diff -r e043135e971d src/lib-storage/index/maildir/maildir-util.c
--- a/src/lib-storage/index/maildir/maildir-util.c	Tue Jun 03 16:04:32 2008 +0300
+++ b/src/lib-storage/index/maildir/maildir-util.c	Tue Jun 03 18:54:27 2008 +0300
@@ -24,9 +24,10 @@
 	int ret;
 
 	fname = maildir_uidlist_lookup(mbox->uidlist, uid, &flags);
-	if (fname == NULL)
+	if (fname == NULL) {
+		i_warning("do_try: uid=%u file name not found", uid);
 		return -2; /* expunged */
-
+	}
 	if ((flags & MAILDIR_UIDLIST_REC_FLAG_NEW_DIR) != 0) {
 		/* probably in new/ dir */
 		T_BEGIN {
@@ -45,6 +46,8 @@
 		path = t_strconcat(mbox->path, "/cur/", fname, NULL);
 		ret = callback(mbox, path, context);
 	} T_END;
+	if (ret == 0)
+		i_warning("do_try: uid=%u file=%s not found", uid, fname);
 	return ret;
 }
 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to