When forced to use the IP, place it in square brackets.
authorJeffrey Stedfast <fejj@helixcode.com>
Wed, 2 Aug 2000 00:29:53 +0000 (00:29 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Wed, 2 Aug 2000 00:29:53 +0000 (00:29 +0000)
2000-08-01  Jeffrey Stedfast  <fejj@helixcode.com>

* providers/smtp/camel-smtp-transport.c (smtp_helo): When forced
to use the IP, place it in square brackets.

camel/ChangeLog
camel/providers/smtp/camel-smtp-transport.c

index 6966ac0..ace0859 100644 (file)
@@ -1,5 +1,8 @@
 2000-08-01  Jeffrey Stedfast  <fejj@helixcode.com>
 
+       * providers/smtp/camel-smtp-transport.c (smtp_helo): When forced
+       to use the IP, place it in square brackets.
+
        * providers/imap/camel-imap-utils.c (imap_translate_sexp): New and
        improved sexp parser. An honest try at using e-sexp is wrapped in
        a #ifdef at the bottom of the file but is currently not used
index 59ee245..0f70d63 100644 (file)
@@ -504,13 +504,18 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
        host = gethostbyaddr ((gchar *)&transport->localaddr.sin_addr, sizeof (transport->localaddr.sin_addr), AF_INET);
 
        /* hiya server! how are you today? */
-       if (transport->smtp_is_esmtp)
-               cmdbuf = g_strdup_printf ("EHLO %s\r\n", host && host->h_name ? host->h_name : 
-                                         inet_ntoa (transport->localaddr.sin_addr));
-       else
-               cmdbuf = g_strdup_printf ("HELO %s\r\n", host && host->h_name ? host->h_name : 
-                                         inet_ntoa (transport->localaddr.sin_addr));
-
+       if (transport->smtp_is_esmtp) {
+               if (host && host->h_name)
+                       cmdbuf = g_strdup_printf ("EHLO %s\r\n", host->h_name);
+               else
+                       cmdbuf = g_strdup_printf ("EHLO [%s]\r\n", inet_ntoa (transport->localaddr.sin_addr));
+       } else {
+               if (host && host->h_name)
+                       cmdbuf = g_strdup_printf ("HELO %s\r\n", host->h_name);
+               else
+                       cmdbuf = g_strdup_printf ("HELO [%s]\r\n", inet_ntoa (transport->localaddr.sin_addr));
+       }
+       
        d(fprintf (stderr, "sending : %s", cmdbuf));
        if (camel_stream_write (transport->ostream, cmdbuf, strlen (cmdbuf)) == -1) {
                g_free (cmdbuf);