From 014f9aec1c45d5c6384a11daf8820ccb1495aa9a Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 22 Jun 2002 21:10:04 +0000 Subject: More patches by Sunil. svn path=/trunk/; revision=3653 --- sink.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'sink.c') diff --git a/sink.c b/sink.c index e76c9d9c..ca2dc657 100644 --- a/sink.c +++ b/sink.c @@ -237,14 +237,25 @@ static int send_bouncemail(struct query *ctl, struct msgblk *msg, strcat(daemon_name, host_fqdn()); /* we need only SMTP for this purpose */ - if ((sock = SockOpen("localhost", SMTP_PORT, NULL, NULL)) == -1 - || SMTP_ok(sock) != SM_OK - || SMTP_helo(sock, fetchmailhost) != SM_OK - || SMTP_from(sock, daemon_name, (char *)NULL) != SM_OK - || SMTP_rcpt(sock, bounce_to) != SM_OK - || SMTP_data(sock) != SM_OK) + if ((sock = SockOpen("localhost", SMTP_PORT, NULL, NULL)) == -1) return(FALSE); + if (SMTP_ok(sock) != SM_OK) + { + SockClose(sock); + return FALSE; + } + + if (SMTP_helo(sock, fetchmailhost) != SM_OK + || SMTP_from(sock, daemon_name, (char *)NULL) != SM_OK + || SMTP_rcpt(sock, bounce_to) != SM_OK + || SMTP_data(sock) != SM_OK) + { + SMTP_quit(sock); + SockClose(sock); + return(FALSE); + } + /* our first duty is to keep the sacred foo counters turning... */ #ifdef HAVE_SNPRINTF snprintf(boundary, sizeof(boundary), @@ -334,7 +345,10 @@ static int send_bouncemail(struct query *ctl, struct msgblk *msg, SockPrintf(sock, "--%s--\r\n", boundary); if (SMTP_eom(sock) != SM_OK || SMTP_quit(sock)) + { + SockClose(sock); return(FALSE); + } SockClose(sock); -- cgit v1.2.3