[sylpheed:36843] IMAP authenticate plain

Sergey Pinaev dfo at antex.ru
Thu Aug 1 23:05:51 JST 2019


hi.
looks like recent (after year 2013 ?) M$ Exchange servers do not
allow clients to specify "authorization identity" in AUTHENTICATE PLAIN.
so, message should be '\0user\0password', instead of 'user\0user\0password'.
(according to rfc "authorization identity" is optional and not providing
it mean "server should choose one from "authentication identity").

--- libsylph/imap.c	(revision 3618)
+++ libsylph/imap.c	(working copy)
@@ -3837,11 +3837,11 @@
 	gchar *response64;
 	gint ok;
 
-	p = response = g_malloc(strlen(user) * 2 + 2 + strlen(pass) + 1);
+	p = response = g_malloc(strlen(user) + strlen(pass) + 3);
+	p[0] = 0;
+	p++;
 	strcpy(p, user);
 	p += strlen(user) + 1;
-	strcpy(p, user);
-	p += strlen(user) + 1;
 	strcpy(p, pass);
 	p += strlen(pass);

-- 
mail="Sergey Pinaev <dfo at antex.ru>"
url="http://`echo $mail | sed 's/.* <\(.*\)@\(.*\)>/\1.\2/'`"


More information about the Sylpheed mailing list