following the "screw murphy" principle and commiting untested patch:

obey LOGINDISABLED
This commit is contained in:
Oswald Buddenhagen 2004-01-30 23:35:50 +00:00
parent 0e8455fde1
commit c2c4490431
2 changed files with 9 additions and 0 deletions

View File

@ -483,6 +483,8 @@ imap_exec (imap_t * imap, const char *fmt, ...)
imap->have_uidplus = 1; imap->have_uidplus = 1;
else if (!strcmp ("NAMESPACE", arg)) else if (!strcmp ("NAMESPACE", arg))
imap->have_namespace = 1; imap->have_namespace = 1;
else if (!strcmp ("LOGINDISABLED", arg))
imap->have_nologin = 1;
#if HAVE_LIBSSL #if HAVE_LIBSSL
else if (!strcmp ("STARTTLS", arg)) else if (!strcmp ("STARTTLS", arg))
imap->have_starttls = 1; imap->have_starttls = 1;
@ -761,6 +763,7 @@ imap_connect (config_t * cfg)
imap->have_uidplus = 0; imap->have_uidplus = 0;
imap->have_namespace = 0; imap->have_namespace = 0;
imap->have_cram = 0; imap->have_cram = 0;
imap->have_nologin = 0;
/* imap->have_starttls = 0; */ /* imap->have_starttls = 0; */
if (imap_exec (imap, "CAPABILITY")) if (imap_exec (imap, "CAPABILITY"))
goto bail; goto bail;
@ -829,6 +832,11 @@ imap_connect (config_t * cfg)
else else
#endif #endif
{ {
if (imap->have_nologin)
{
fprintf (stderr, "Skipping %s, server forbids LOGIN\n", cfg->path);
goto bail;
}
#if HAVE_LIBSSL #if HAVE_LIBSSL
if (!use_ssl) if (!use_ssl)
#endif #endif

View File

@ -153,6 +153,7 @@ typedef struct
list_t *ns_personal; list_t *ns_personal;
list_t *ns_other; list_t *ns_other;
list_t *ns_shared; list_t *ns_shared;
unsigned int have_nologin:1;
unsigned int have_uidplus:1; unsigned int have_uidplus:1;
unsigned int have_namespace:1; unsigned int have_namespace:1;
#if HAVE_LIBSSL #if HAVE_LIBSSL