diff -ru5 xfce4-mailwatch-plugin-1.2.0/libmailwatch-core/mailwatch-mailbox-imap.c xfce4-mailwatch-plugin-1.2.0.neu/libmailwatch-core/mailwatch-mailbox-imap.c --- xfce4-mailwatch-plugin-1.2.0/libmailwatch-core/mailwatch-mailbox-imap.c 2013-10-24 14:03:30.000000000 +0200 +++ xfce4-mailwatch-plugin-1.2.0.new/libmailwatch-core/mailwatch-mailbox-imap.c 2017-03-19 12:49:48.814442585 +0100 @@ -278,18 +278,10 @@ bin = imap_recv_command(imailbox, net_conn, buf, BUFSIZE); DBG("response from CAPABILITY (%d): %s", bin, bin>0?buf:"(nada)"); if(bin <= 0) goto cleanuperr; - if(strstr(buf, "LOGINDISABLED")) { - xfce_mailwatch_log_message(imailbox->mailwatch, - XFCE_MAILWATCH_MAILBOX(imailbox), - XFCE_MAILWATCH_LOG_ERROR, - _("Secure IMAP is not available, and the IMAP server does not support plaintext logins.")); - goto cleanuperr; - } - #ifdef HAVE_SSL_SUPPORT if(strstr(buf, "AUTH=CRAM-MD5")) { /* the server supports CRAM-MD5; prefer that over LOGIN */ g_snprintf(buf, BUFSIZE, "%05d AUTHENTICATE CRAM-MD5\r\n", ++imailbox->imap_tag); @@ -347,10 +339,18 @@ return TRUE; } } #endif + if(strstr(buf, "LOGINDISABLED")) { + xfce_mailwatch_log_message(imailbox->mailwatch, + XFCE_MAILWATCH_MAILBOX(imailbox), + XFCE_MAILWATCH_LOG_ERROR, + _("Secure IMAP is not available, and the IMAP server does not support plaintext logins.")); + goto cleanuperr; + } + /* no cram-md5 support, send the normal creds */ g_snprintf(buf, BUFSIZE, "%05d LOGIN \"%s\" \"%s\"\r\n", ++imailbox->imap_tag, username, password); bout = imap_send(imailbox, net_conn, buf); DBG("sent login (%d)", bout);