commit bffb26a1b39f216d1aaf4ade17e20bf286530fac
Author: Oswald Buddenhagen <[email protected]>
Date:   Sat Apr 13 19:25:20 2013 +0200

    always list INBOX when asked for it
    
    it's there even if it's not there. says IMAP. no need to contradict.

 src/drv_maildir.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/drv_maildir.c b/src/drv_maildir.c
index 2bddfdc..a5e5df7 100644
--- a/src/drv_maildir.c
+++ b/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" ) );
 }

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to