[evolution-patches] 69109, ipv6 literal smtp HELO




Finishes off the previous patch, as per rfc2821, 4.1.3.

--
Michael Zucchi <notzed ximian com>
"Free Software, putting the Free back in Free Market."
Novell's Evolution and Free Software Developer
Index: camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.2251.2.23
diff -u -p -r1.2251.2.23 ChangeLog
--- camel/ChangeLog	22 Nov 2004 01:51:18 -0000	1.2251.2.23
+++ camel/ChangeLog	22 Nov 2004 03:52:02 -0000
@@ -1,3 +1,10 @@
+2004-11-22  Not Zed  <NotZed Ximian com>
+
+	** See bug #69109.
+
+	* providers/smtp/camel-smtp-transport.c (smtp_helo): if we have
+	ipv6 address and it is numeric, prefix it with "IPv6:"
+
 2004-11-10  Not Zed  <NotZed Ximian com>
 
 	** See bug #69109.
Index: camel/providers/smtp/camel-smtp-transport.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/providers/smtp/camel-smtp-transport.c,v
retrieving revision 1.157.14.5
diff -u -p -r1.157.14.5 camel-smtp-transport.c
--- camel/providers/smtp/camel-smtp-transport.c	22 Nov 2004 01:51:18 -0000	1.157.14.5
+++ camel/providers/smtp/camel-smtp-transport.c	22 Nov 2004 03:52:03 -0000
@@ -884,8 +884,7 @@ smtp_helo (CamelSmtpTransport *transport
 {
 	/* say hello to the server */
 	char *name = NULL, *cmdbuf = NULL, *respbuf = NULL;
-	const char *token;
-	int numeric = FALSE;
+	const char *token, *numeric = NULL;
 	
 	/* these are flags that we set, so unset them in case we
 	   are being called a second time (ie, after a STARTTLS) */
@@ -905,13 +904,20 @@ smtp_helo (CamelSmtpTransport *transport
 	if (camel_getnameinfo(transport->localaddr, transport->localaddrlen, &name, NULL, NI_NAMEREQD, NULL) != 0) {
 		if (camel_getnameinfo(transport->localaddr, transport->localaddrlen, &name, NULL, NI_NUMERICHOST, NULL) != 0)
 			name = g_strdup("localhost.localdomain");
-		else
-			numeric = TRUE;
+		else {
+			if (transport->localaddr->sa_family == AF_INET6)
+				numeric = "IPv6:";
+			else
+				numeric = "";
+		}
 	}
 	
 	/* hiya server! how are you today? */
 	token = (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) ? "EHLO" : "HELO";
-	cmdbuf = g_strdup_printf(numeric ? "%s [%s]\r\n" : "%s %s\r\n", token, name);
+	if (numeric)
+		cmdbuf = g_strdup_printf("%s [%s%s]\r\n", token, numeric, name);
+	else
+		cmdbuf = g_strdup_printf("%s %s\r\n", token, name);
 	g_free (name);
 	
 	d(fprintf (stderr, "sending : %s", cmdbuf));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]