From f37e40d9aa3481720c5d4bdac821d443701beeba Mon Sep 17 00:00:00 2001 From: trisk Date: Thu, 26 Jul 2007 13:31:26 +0000 Subject: [PATCH] * Fix some obvious bugs in smtpd's remote host resolution. --- src/agents/smtp/smtpd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/agents/smtp/smtpd.c b/src/agents/smtp/smtpd.c index 441ee92..fd432ba 100644 --- a/src/agents/smtp/smtpd.c +++ b/src/agents/smtp/smtpd.c @@ -2235,22 +2235,22 @@ DeliverRemoteMessage (ConnectionStruct * Client, unsigned char *Sender, /* Clean up a potential ip address in the host name (e.g. jdoe@[1.1.1.1] ) */ if (Host[0] == '[') { + int host; ptr = strchr (Host, ']'); if (ptr) *ptr = '\0'; memmove (Host, Host + 1, strlen (Host + 1) + 1); /* Check for an IP address */ - int host; - Client->remotesmtp.conn->socketAddress.sin_addr.s_addr = host; if ((host = inet_addr (Host)) != -1) { GoByAddr = TRUE; UsingMX = FALSE; } + Client->remotesmtp.conn->socketAddress.sin_addr.s_addr = host; } if (!GoByAddr && UseRelayHost) { - int relayhost; - Client->remotesmtp.conn->socketAddress.sin_addr.s_addr=relayhost; + int relayhost = inet_addr(RelayHost); + Client->remotesmtp.conn->socketAddress.sin_addr.s_addr = relayhost; if (relayhost == -1) { status=XplDnsResolve(RelayHost, &DNSARec, XPL_RR_A); /*fprintf (stderr, "%s:%d Looked up relay host %s: %d\n", __FILE__, __LINE__, RelayHost, status);*/ @@ -3767,7 +3767,7 @@ ProcessLocalEntry (ConnectionStruct * Client, unsigned long Size, static void HandleQueueConnection (void *ClientIn) { - int ReplyInt, Queue; + int ReplyInt, Queue = Q_INCOMING; unsigned char Reply[1024]; ConnectionStruct *Client = (ConnectionStruct *) ClientIn; unsigned char *ptr;