aboutsummaryrefslogtreecommitdiffstats
path: root/sink.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2002-06-22 21:10:04 +0000
committerEric S. Raymond <esr@thyrsus.com>2002-06-22 21:10:04 +0000
commit014f9aec1c45d5c6384a11daf8820ccb1495aa9a (patch)
tree7ac618667cb5558ac79d146ce6197e186f3b5ef8 /sink.c
parent3a8d7cb928c1e564fb031a0402103573f70c73b4 (diff)
downloadfetchmail-014f9aec1c45d5c6384a11daf8820ccb1495aa9a.tar.gz
fetchmail-014f9aec1c45d5c6384a11daf8820ccb1495aa9a.tar.bz2
fetchmail-014f9aec1c45d5c6384a11daf8820ccb1495aa9a.zip
More patches by Sunil.
svn path=/trunk/; revision=3653
Diffstat (limited to 'sink.c')
-rw-r--r--sink.c26
1 files changed, 20 insertions, 6 deletions
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);