From 7f771cb4bc55e6c7c00f00552237e26c3dbbb798 Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan@rename-it.nl>
Date: Thu, 6 Jan 2011 15:50:31 +0100
Subject: [PATCH] ManageSieve: removed TODO status of adding ANONYMOUS SASL
 support, since the RFC specification no longer describes it.

---
 README                                      | 3 ---
 TODO                                        | 1 -
 src/managesieve-login/client-authenticate.c | 8 +++-----
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/README b/README
index 89f076279..387590363 100644
--- a/README
+++ b/README
@@ -279,9 +279,6 @@ ManageSieve
 	  These clients are specifically written for Cyrus timsieved and fail on
 	  multiple stages of the protocol when connected to Pigeonhole ManageSieve.
 
-* The ANONYMOUS authentication mechanism is currently not supported and
-  explicitly denied.
-
 Authors
 =======
 
diff --git a/TODO b/TODO
index 1ff1ab578..b24c5bbb0 100644
--- a/TODO
+++ b/TODO
@@ -51,7 +51,6 @@ Next (in order of descending priority/precedence):
 	  are tested at least once.
 * Fix ManageSieve proxy to recognize response codes from the backend and forward
   them to the user if appropriate/safe.
-* Implement proper support for ManageSieve SASL ANONYMOUS login.
 * Test ManageSieve behavior thoroughly:
 	- Test pipelined behavior
 	- Test proxy authentication
diff --git a/src/managesieve-login/client-authenticate.c b/src/managesieve-login/client-authenticate.c
index 091cdbdf1..33d6663fd 100644
--- a/src/managesieve-login/client-authenticate.c
+++ b/src/managesieve-login/client-authenticate.c
@@ -33,6 +33,7 @@ const char *client_authenticate_get_capabilities
 	mech = sasl_server_get_advertised_mechs(client, &count);
 
 	for (i = 0; i < count; i++) {
+		/* Filter ANONYMOUS mechanism, ManageSieve has no use-case for it */
 		if ( (mech[i].flags & MECH_SEC_ANONYMOUS) == 0 ) {
 			if ( !first )
 				str_append_c(str, ' ');
@@ -215,13 +216,10 @@ int cmd_authenticate
 	if (*mech_name == '\0') 
 		return -1;
 
-	/* FIXME: This refuses the ANONYMOUS mechanism. 
-	 *   This can be removed once anonymous login is implemented according to the 
-	 *   draft RFC. - Stephan
-	 */
+	/* Refuse the ANONYMOUS mechanism. */
 	if ( strncasecmp(mech_name, "ANONYMOUS", 9) == 0 ) {
 		client_send_no
-			(&msieve_client->common, "ANONYMOUS mechanism is not implemented.");		
+			(&msieve_client->common, "ANONYMOUS login is not allowed.");
 		return 0;
 	}
 
-- 
GitLab