Merge branch '1.3'
Conflicts: configure.ac src/drv_imap.c
This commit is contained in:
commit
062706fcbf
|
@ -1382,13 +1382,14 @@ parse_list_rsp_p2( imap_store_t *ctx, list_t *list, char *cmd ATTR_UNUSED )
|
||||||
}
|
}
|
||||||
arg = list->val;
|
arg = list->val;
|
||||||
argl = (int)list->len;
|
argl = (int)list->len;
|
||||||
if (is_inbox( ctx, arg, argl )) {
|
if ((l = strlen( ctx->prefix ))) {
|
||||||
// The server might be weird and have a non-uppercase INBOX. It
|
if (!starts_with( arg, argl, ctx->prefix, l )) {
|
||||||
// may legitimately do so, but we need the canonical spelling.
|
if (is_inbox( ctx, arg, argl )) {
|
||||||
memcpy( arg, "INBOX", 5 );
|
// INBOX and its subfolders bypass the namespace.
|
||||||
} else if ((l = strlen( ctx->prefix ))) {
|
goto inbox;
|
||||||
if (!starts_with( arg, argl, ctx->prefix, l ))
|
}
|
||||||
return LIST_OK;
|
return LIST_OK;
|
||||||
|
}
|
||||||
arg += l;
|
arg += l;
|
||||||
argl -= l;
|
argl -= l;
|
||||||
// A folder named "INBOX" would be indistinguishable from the
|
// A folder named "INBOX" would be indistinguishable from the
|
||||||
|
@ -1400,6 +1401,14 @@ 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 );
|
warn( "IMAP warning: ignoring INBOX in %s\n", ctx->prefix );
|
||||||
return LIST_OK;
|
return LIST_OK;
|
||||||
}
|
}
|
||||||
|
} else if (is_inbox( ctx, arg, argl )) {
|
||||||
|
inbox:
|
||||||
|
// The server might be weird and have a non-uppercase INBOX. It
|
||||||
|
// may legitimately do so, but we need the canonical spelling.
|
||||||
|
// Note that we do that only after prefix matching, under the
|
||||||
|
// assumption that the NAMESPACE (or Path) matches the
|
||||||
|
// capitalization of LIST.
|
||||||
|
memcpy( arg, "INBOX", 5 );
|
||||||
}
|
}
|
||||||
if (argl >= 5 && !memcmp( arg + argl - 5, ".lock", 5 )) /* workaround broken servers */
|
if (argl >= 5 && !memcmp( arg + argl - 5, ".lock", 5 )) /* workaround broken servers */
|
||||||
return LIST_OK;
|
return LIST_OK;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user