commit aab776303e6c58c26b4be2badbb94745290d356c Author: Oswald Buddenhagen <o...@users.sf.net> Date: Thu Jun 2 19:41:03 2011 +0200
IMAP: reject unqualified non-uppercased INBOX spellings otherwise the server would interpret it as INBOX contrary to our expectations, which might lead to moderately surprising effects. if you really want to sync your ~/maildir/inbox to the IMAP INBOX, specify it as the Maildir Store's Inbox. src/drv_imap.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/drv_imap.c b/src/drv_imap.c index 2c0e4b0..53c43a8 100644 --- a/src/drv_imap.c +++ b/src/drv_imap.c @@ -1359,9 +1359,17 @@ static int prepare_box( char **buf, const imap_store_t *ctx ) { const char *name = ctx->name; + const char *pfx = ctx->prefix; - return prepare_name( buf, ctx, - (starts_with( name, UINT_MAX, "INBOX", 5 ) && (!name[5] || name[5] == '/')) ? "" : ctx->prefix, name ); + if (starts_with_upper( name, UINT_MAX, "INBOX", 5 ) && (!name[5] || name[5] == '/')) { + if (!memcmp( name, "INBOX", 5 )) { + pfx = ""; + } else if (!*pfx) { + error( "IMAP error: cannot use unqualified '%s'. Did you mean INBOX?", name ); + return -1; + } + } + return prepare_name( buf, ctx, pfx, name ); } static int _______________________________________________ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel