Explorar el Código

always list INBOX when asked for it

it's there even if it's not there. says IMAP. no need to contradict.
Oswald Buddenhagen hace 12 años
padre
commit
e7c96f8891
Se han modificado 1 ficheros con 6 adiciones y 4 borrados
  1. 6 4
      src/drv_maildir.c

+ 6 - 4
src/drv_maildir.c

@@ -202,16 +202,18 @@ maildir_list_recurse( store_t *gctx, int isBox, int *flags, const char *inbox,
                       char *path, int pathLen, char *name, int nameLen )
 {
 	DIR *dir;
-	int pl, nl;
+	int pl, nl, missing;
 	struct dirent *de;
 	struct stat st;
 
 	if (isBox) {
 		nfsnprintf( path + pathLen, _POSIX_PATH_MAX - pathLen, "/cur" );
-		if (stat( path, &st ) || !S_ISDIR(st.st_mode))
+		missing = stat( path, &st ) || !S_ISDIR(st.st_mode);
+		if (!missing || isBox > 1)
+			add_string_list( &gctx->boxes, name );
+		if (missing)
 			return 0;
 		path[pathLen] = 0;
-		add_string_list( &gctx->boxes, name );
 		name[nameLen++] = '/';
 	}
 	if (!(dir = opendir( path ))) {
@@ -254,7 +256,7 @@ maildir_list_inbox( store_t *gctx, int *flags )
 
 	*flags &= ~LIST_INBOX;
 	return maildir_list_recurse(
-	        gctx, 1, flags, 0,
+	        gctx, 2, flags, 0,
 	        path, nfsnprintf( path, _POSIX_PATH_MAX, "%s", ((maildir_store_conf_t *)gctx->conf)->inbox ),
 	        name, nfsnprintf( name, _POSIX_PATH_MAX, "INBOX" ) );
 }