aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--driver.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/driver.c b/driver.c
index 722f76e9..d6ea0a9e 100644
--- a/driver.c
+++ b/driver.c
@@ -866,7 +866,7 @@ int num; /* index of message */
}
else
{
- char *ap, *ctt, options[MSGBUFSIZE], addr[128];
+ char *ap, *ctt, options[MSGBUFSIZE], addr[128], *desthost;
/* build a connection to the SMTP listener */
if ((smtp_open(ctl) == -1))
@@ -991,13 +991,14 @@ int num; /* index of message */
* or MX but not a CNAME. Some listeners (like exim)
* enforce this.
*/
+ desthost = ctl->smtphost ? ctl->smtphost : "localhost";
for (idp = xmit_names; idp; idp = idp->next)
if (idp->val.num == XMIT_ACCEPT)
{
#ifdef HAVE_SNPRINTF
- snprintf(addr, sizeof(addr)-1, "%s@%s", idp->id,ctl->smtphost);
+ snprintf(addr, sizeof(addr)-1, "%s@%s", idp->id, desthost);
#else
- sprintf(addr, "%s@%s", idp->id, ctl->smtphost);
+ sprintf(addr, "%s@%s", idp->id, desthost);
#endif /* HAVE_SNPRINTF */
if (SMTP_rcpt(ctl->smtp_socket, addr) == SM_OK)
@@ -1013,9 +1014,9 @@ int num; /* index of message */
if (!good_addresses)
{
#ifdef HAVE_SNPRINTF
- snprintf(addr, sizeof(addr)-1, "%s@%s", idp->id, ctl->smtphost);
+ snprintf(addr, sizeof(addr)-1, "%s@%s", idp->id, desthost);
#else
- sprintf(addr, "%s@%s", idp->id, ctl->smtphost);
+ sprintf(addr, "%s@%s", idp->id, desthost);
#endif /* HAVE_SNPRINTF */
if (SMTP_rcpt(ctl->smtp_socket, user) != SM_OK)