changeset 2698:55308ec89931 HEAD

Advertise all SASL mechanisms in old-style SASL discovery. Patch by Andrey Panin.
author Timo Sirainen <tss@iki.fi>
date Thu, 07 Oct 2004 22:39:24 +0300
parents f3edd5e3c371
children 479680ed12ee
files src/pop3-login/client-authenticate.c
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/pop3-login/client-authenticate.c	Thu Oct 07 22:38:05 2004 +0300
+++ b/src/pop3-login/client-authenticate.c	Thu Oct 07 22:39:24 2004 +0300
@@ -309,16 +309,19 @@
 	string_t *buf;
 	size_t argslen;
 
-	if (*args == '\0' &&
-	    auth_client_find_mech(auth_client, "NTLM") != NULL) {
-		/* This is needed to allow MS Outlook to use NTLM
-		   authentication. Sometimes this kludge is called
-		   "old-style SASL discovery". */
+	if (*args == '\0') {
+		/* Old-style SASL discovery, used by MS Outlook */
+		int i, count;
 		client_send_line(client, "+OK");
- 		client_send_line(client, "NTLM");
+		mech = auth_client_get_available_mechs(auth_client, &count);
+		for (i = 0; i < count; i++) {
+			if (mech[i].advertise) {
+		 		client_send_line(client, mech[i].name);
+			}
+		}
  		client_send_line(client, ".");
  		return TRUE;
- 	}
+	}
 
 	/* <mechanism name> <initial response> */
 	p = strchr(args, ' ');