From 417ed3307c628d8c8daad2da6a594f1fbf6015a3 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 18 Dec 1998 16:48:24 +0000 Subject: Avoid postmaster screwage. svn path=/trunk/; revision=2285 --- sink.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'sink.c') diff --git a/sink.c b/sink.c index 7e90d0f6..e98630e3 100644 --- a/sink.c +++ b/sink.c @@ -627,7 +627,9 @@ int open_sink(struct query *ctl, struct msgblk *msg, else /* forward to an SMTP or LMTP listener */ { const char *ap; - char options[MSGBUFSIZE], addr[128], **from_responses; + char options[MSGBUFSIZE]; + char addr[HOSTLEN+USERNAMELEN+1]; + char **from_responses; int total_addresses; /* build a connection to the SMTP listener */ @@ -729,11 +731,16 @@ int open_sink(struct query *ctl, struct msgblk *msg, */ if (!(*good_addresses)) { + if (strchr(run.postmaster, '@')) + strcpy(addr, run.postmaster); + else + { #ifdef HAVE_SNPRINTF - snprintf(addr, sizeof(addr)-1, "%s@%s", run.postmaster, ctl->destaddr); + snprintf(addr, sizeof(addr)-1, "%s@%s", run.postmaster, ctl->destaddr); #else - sprintf(addr, "%s@%s", run.postmaster, ctl->destaddr); + sprintf(addr, "%s@%s", run.postmaster, ctl->destaddr); #endif /* HAVE_SNPRINTF */ + } if (SMTP_rcpt(ctl->smtp_socket, addr) != SM_OK) { -- cgit v1.2.3