aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/smtp
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-08-02 08:29:53 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-08-02 08:29:53 +0800
commitea8003dcd6d7b5a60be930d9d213c313a983f33e (patch)
tree84b4fca3d85e64899ac1840ce777bb7dcba45956 /camel/providers/smtp
parent2c23afbef1edb9d907d3fd871876fe7cbe201d2f (diff)
downloadgsoc2013-evolution-ea8003dcd6d7b5a60be930d9d213c313a983f33e.tar
gsoc2013-evolution-ea8003dcd6d7b5a60be930d9d213c313a983f33e.tar.gz
gsoc2013-evolution-ea8003dcd6d7b5a60be930d9d213c313a983f33e.tar.bz2
gsoc2013-evolution-ea8003dcd6d7b5a60be930d9d213c313a983f33e.tar.lz
gsoc2013-evolution-ea8003dcd6d7b5a60be930d9d213c313a983f33e.tar.xz
gsoc2013-evolution-ea8003dcd6d7b5a60be930d9d213c313a983f33e.tar.zst
gsoc2013-evolution-ea8003dcd6d7b5a60be930d9d213c313a983f33e.zip
When forced to use the IP, place it in square brackets.
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. svn path=/trunk/; revision=4462
Diffstat (limited to 'camel/providers/smtp')
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 59ee2457f0..0f70d6314e 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -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);