changeset 1060:d051d031fc09 HEAD

If there's multiple mailboxes named "inbox", ignore them at least for now (eg. /var/mail/inbox, ~/mail/inbox).
author Timo Sirainen <tss@iki.fi>
date Fri, 31 Jan 2003 07:18:16 +0200
parents d805c2f1d6a9
children 6a19c941a1fc
files src/lib-storage/index/maildir/maildir-list.c src/lib-storage/index/mbox/mbox-list.c
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-list.c	Thu Jan 30 21:52:39 2003 +0200
+++ b/src/lib-storage/index/maildir/maildir-list.c	Fri Jan 31 07:18:16 2003 +0200
@@ -137,8 +137,13 @@
 			continue;
 		}
 
-		if (strcasecmp(fname+1, "INBOX") == 0)
+		if (strcasecmp(fname+1, "INBOX") == 0) {
+			if (found_inbox) {
+				/* another inbox, ignore it */
+				continue;
+			}
 			found_inbox = TRUE;
+		}
 
 		t_push();
 		flags = maildir_get_marked_flags(storage, path);
--- a/src/lib-storage/index/mbox/mbox-list.c	Thu Jan 30 21:52:39 2003 +0200
+++ b/src/lib-storage/index/mbox/mbox-list.c	Fri Jan 31 07:18:16 2003 +0200
@@ -121,7 +121,11 @@
 				break;
 			}
 		} else if (match > 0 &&
-			   strcmp(fullpath, storage->inbox_file) != 0) {
+			   strcmp(fullpath, storage->inbox_file) != 0 &&
+			   strcasecmp(listpath, "INBOX") != 0) {
+			/* don't match any INBOX here, it's added later.
+			   we might also have ~/mail/inbox, ~/mail/Inbox etc.
+			   Just ignore them for now. */
 			t_push();
 			callback(storage, listpath, MAILBOX_NOINFERIORS, context);
 			t_pop();