Sophie

Sophie

distrib > Mandriva > 2007.1 > x86_64 > media > main-updates-src > by-pkgid > 62ea43af7ec497e7a578db1ca6717d17 > files > 29

postfix-2.3.8-1.1mdv2007.1.src.rpm

--- snapshot-20010525/src/smtp/smtp_sasl_proto.c.auth	Tue May 22 20:27:06 2001
+++ snapshot-20010525/src/smtp/smtp_sasl_proto.c	Sat May 26 18:35:31 2001
@@ -61,6 +61,7 @@
 
 #include <msg.h>
 #include <mymalloc.h>
+#include <stringops.h>
 
 /* Global library. */
 
@@ -77,21 +78,23 @@
 
 void    smtp_sasl_helo_auth(SMTP_STATE *state, const char *words)
 {
-
+    char *my_name = "smtp_sasl_helo_auth";
+    char *cp;
     /*
      * XXX If the server offers a null list of authentication mechanisms,
      * then pretend that the server doesn't support SASL authentication.
+     *
+     * XXX Some servers offer AUTH multiple times, with different lists of
+     * methods. We could try to be clever and compute unions of those lists,
+     * but simple concatenation may do the job.
      */
     if (state->sasl_mechanism_list) {
 	if (strcasecmp(state->sasl_mechanism_list, words) == 0)
 	    return;
+	cp = concatenate(state->sasl_mechanism_list, " ", words, (char *) 0);
 	myfree(state->sasl_mechanism_list);
-	msg_warn("%s offered AUTH option multiple times",
-		 state->session->namaddr);
-	state->sasl_mechanism_list = 0;
-	state->features &= ~SMTP_FEATURE_AUTH;
-    }
-    if (strlen(words) > 0) {
+	state->sasl_mechanism_list = cp;
+    } else if (strlen(words) > 0) {
 	state->sasl_mechanism_list = mystrdup(words);
 	state->features |= SMTP_FEATURE_AUTH;
     } else {