don't use NAMESPACE unless the server supports it

This commit is contained in:
Michael Elkins 2000-12-23 21:57:06 +00:00
parent b3eb5661eb
commit 6f4cd030f8
2 changed files with 10 additions and 9 deletions

8
imap.c
View File

@ -410,6 +410,8 @@ imap_exec (imap_t * imap, const char *fmt, ...)
imap->have_starttls = 1;
else if (!strcmp ("AUTH=CRAM-MD5", arg))
imap->have_cram = 1;
else if (!strcmp ("NAMESPACE", arg))
imap->have_namespace = 1;
}
#endif
}
@ -607,10 +609,9 @@ imap_open (config_t * box, unsigned int minuid)
ret = imap_exec (imap, "LOGIN \"%s\" \"%s\"", box->user, box->pass);
}
if (!ret)
{
/* get NAMESPACE info */
if (box->use_namespace && !imap_exec (imap, "NAMESPACE"))
if (!ret && box->use_namespace && imap->have_namespace &&
!imap_exec (imap, "NAMESPACE"))
{
/* XXX for now assume personal namespace */
if (is_list (imap->ns_personal) &&
@ -620,7 +621,6 @@ imap_open (config_t * box, unsigned int minuid)
ns_prefix = imap->ns_personal->child->child->val;
}
}
}
if (!ret)
{

View File

@ -130,6 +130,7 @@ typedef struct
list_t *ns_personal;
list_t *ns_other;
list_t *ns_shared;
unsigned int have_namespace:1;
#if HAVE_LIBSSL
unsigned int have_cram:1;
unsigned int have_starttls:1;