[Commits] [SCM] claws branch, master, updated. 3.13.2-43-g7047fa7

ticho at claws-mail.org ticho at claws-mail.org
Fri Feb 19 17:13:33 CET 2016


The branch, master has been updated
       via  7047fa7f29ac1837915c139bc4ca71b153886d3e (commit)
      from  07c41544264fbc6779d654372acca453d243d68a (commit)

Summary of changes:
 src/imap.c          |   13 +++++++++++++
 src/imap.h          |    3 ++-
 src/prefs_account.c |    1 +
 3 files changed, 16 insertions(+), 1 deletion(-)


- Log -----------------------------------------------------------------
commit 7047fa7f29ac1837915c139bc4ca71b153886d3e
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Fri Feb 19 17:13:08 2016 +0100

    Enable SASL PLAIN auth mechanism for IMAP accounts.

diff --git a/src/imap.c b/src/imap.c
index f40d002..241ad0f 100644
--- a/src/imap.c
+++ b/src/imap.c
@@ -902,6 +902,9 @@ static gint imap_auth(IMAPSession *session, const gchar *user, const gchar *pass
 	case IMAP_AUTH_SCRAM_SHA1:
 		ok = imap_cmd_login(session, user, pass, "SCRAM-SHA-1");
 		break;
+	case IMAP_AUTH_PLAIN:
+		ok = imap_cmd_login(session, user, pass, "PLAIN");
+		break;
 	case IMAP_AUTH_LOGIN:
 		ok = imap_cmd_login(session, user, pass, "LOGIN");
 		break;
@@ -914,12 +917,14 @@ static gint imap_auth(IMAPSession *session, const gchar *user, const gchar *pass
 				"\t CRAM-MD5 %d\n"
 				"\t DIGEST-MD5 %d\n"
 				"\t SCRAM-SHA-1 %d\n"
+				"\t PLAIN %d\n"
 				"\t LOGIN %d\n"
 				"\t GSSAPI %d\n", 
 			imap_has_capability(session, "ANONYMOUS"),
 			imap_has_capability(session, "CRAM-MD5"),
 			imap_has_capability(session, "DIGEST-MD5"),
 			imap_has_capability(session, "SCRAM-SHA-1"),
+			imap_has_capability(session, "PLAIN"),
 			imap_has_capability(session, "LOGIN"),
 			imap_has_capability(session, "GSSAPI"));
 		if (imap_has_capability(session, "CRAM-MD5"))
@@ -928,6 +933,8 @@ static gint imap_auth(IMAPSession *session, const gchar *user, const gchar *pass
 			ok = imap_cmd_login(session, user, pass, "DIGEST-MD5");
 		if (ok == MAILIMAP_ERROR_LOGIN && imap_has_capability(session, "SCRAM-SHA-1"))
 			ok = imap_cmd_login(session, user, pass, "SCRAM-SHA-1");
+		if (ok == MAILIMAP_ERROR_LOGIN && imap_has_capability(session, "PLAIN"))
+			ok = imap_cmd_login(session, user, pass, "PLAIN");
 		if (ok == MAILIMAP_ERROR_LOGIN && imap_has_capability(session, "GSSAPI"))
 			ok = imap_cmd_login(session, user, pass, "GSSAPI");
 		if (ok == MAILIMAP_ERROR_LOGIN) /* we always try LOGIN before giving up */
@@ -955,6 +962,12 @@ static gint imap_auth(IMAPSession *session, const gchar *user, const gchar *pass
 				     "SCRAM SASL plugin is installed.");
 		}
 
+		if (type == IMAP_AUTH_PLAIN) {
+			ext_info = _("\n\nPLAIN logins only work if libetpan has been "
+				     "compiled with SASL support and the "
+				     "PLAIN SASL plugin is installed.");
+		}
+
 		if (time(NULL) - last_login_err > 10) {
 			if (!prefs_common.no_recv_err_panel) {
 				alertpanel_error_log(_("Connection to %s failed: "
diff --git a/src/imap.h b/src/imap.h
index a776867..b7eae6c 100644
--- a/src/imap.h
+++ b/src/imap.h
@@ -29,7 +29,8 @@ typedef enum
 	IMAP_AUTH_ANON		= 1 << 2,
 	IMAP_AUTH_GSSAPI	= 1 << 3,
 	IMAP_AUTH_DIGEST_MD5	= 1 << 4,
-	IMAP_AUTH_SCRAM_SHA1	= 1 << 5
+	IMAP_AUTH_SCRAM_SHA1	= 1 << 5,
+	IMAP_AUTH_PLAIN   = 1 << 6
 } IMAPAuthType;
 
 FolderClass *imap_get_class		(void);
diff --git a/src/prefs_account.c b/src/prefs_account.c
index 3fad6cc..e57dd21 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -1584,6 +1584,7 @@ static void receive_create_widget_func(PrefsPage * _page,
 	COMBOBOX_ADD (menu, "GSSAPI", IMAP_AUTH_GSSAPI);
 	COMBOBOX_ADD (menu, "DIGEST-MD5", IMAP_AUTH_DIGEST_MD5);
 	COMBOBOX_ADD (menu, "SCRAM-SHA-1", IMAP_AUTH_SCRAM_SHA1);
+	COMBOBOX_ADD (menu, "PLAIN", IMAP_AUTH_PLAIN);
 
 	hbox1 = gtk_hbox_new (FALSE, 8);
 	gtk_widget_show (hbox1);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list