Browse Source

don't use NAMESPACE unless the server supports it

0.9
Michael Elkins 24 years ago
parent
commit
6f4cd030f8
  1. 8
      imap.c
  2. 1
      isync.h

8
imap.c

@ -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)
{

1
isync.h

@ -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;

Loading…
Cancel
Save