commit 95fedd22a759c791e96e06fea72663a34af3475f
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Mon Nov 18 11:05:52 2019 +0100

    fix IMAP INBOX normalization without Path or NAMESPACE
    
    amends 0ac63223.

 src/drv_imap.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index 92a7bf6..59f716e 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -1272,7 +1272,11 @@ parse_list_rsp_p2( imap_store_t *ctx, list_t *list, char 
*cmd ATTR_UNUSED )
        }
        arg = list->val;
        argl = list->len;
-       if ((l = strlen( ctx->prefix ))) {
+       if (is_inbox( ctx, arg, argl )) {
+               // The server might be weird and have a non-uppercase INBOX. It
+               // may legitimately do so, but we need the canonical spelling.
+               memcpy( arg, "INBOX", 5 );
+       } else if ((l = strlen( ctx->prefix ))) {
                if (starts_with( arg, argl, ctx->prefix, l )) {
                        arg += l;
                        argl -= l;
@@ -1285,10 +1289,6 @@ parse_list_rsp_p2( imap_store_t *ctx, list_t *list, char 
*cmd ATTR_UNUSED )
                                        warn( "IMAP warning: ignoring INBOX in 
%s\n", ctx->prefix );
                                goto skip;
                        }
-               } else if (is_inbox( ctx, arg, argl )) {
-                       // The server might be weird and have a non-uppercase 
INBOX. It
-                       // may legitimately do so, but we need the canonical 
spelling.
-                       memcpy( arg, "INBOX", 5 );
                } else {
                        goto skip;
                }


_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to