commit c2c449043128e8a660814f6df9bc8bae98742928
parent 0e8455fde186100bc8fbfc6e81a3cbb3f8ce9837
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Fri, 30 Jan 2004 23:35:50 +0000
following the "screw murphy" principle and commiting untested patch:
obey LOGINDISABLED
Diffstat:
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/imap.c b/src/imap.c
@@ -483,6 +483,8 @@ imap_exec (imap_t * imap, const char *fmt, ...)
imap->have_uidplus = 1;
else if (!strcmp ("NAMESPACE", arg))
imap->have_namespace = 1;
+ else if (!strcmp ("LOGINDISABLED", arg))
+ imap->have_nologin = 1;
#if HAVE_LIBSSL
else if (!strcmp ("STARTTLS", arg))
imap->have_starttls = 1;
@@ -761,6 +763,7 @@ imap_connect (config_t * cfg)
imap->have_uidplus = 0;
imap->have_namespace = 0;
imap->have_cram = 0;
+ imap->have_nologin = 0;
/* imap->have_starttls = 0; */
if (imap_exec (imap, "CAPABILITY"))
goto bail;
@@ -829,6 +832,11 @@ imap_connect (config_t * cfg)
else
#endif
{
+ if (imap->have_nologin)
+ {
+ fprintf (stderr, "Skipping %s, server forbids LOGIN\n", cfg->path);
+ goto bail;
+ }
#if HAVE_LIBSSL
if (!use_ssl)
#endif
diff --git a/src/isync.h b/src/isync.h
@@ -153,6 +153,7 @@ typedef struct
list_t *ns_personal;
list_t *ns_other;
list_t *ns_shared;
+ unsigned int have_nologin:1;
unsigned int have_uidplus:1;
unsigned int have_namespace:1;
#if HAVE_LIBSSL