Skip to content

Commit

Permalink
Close connections on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
duraseb committed Mar 22, 2016
1 parent 1b41273 commit b059bcd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions net.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,13 @@ deliver_to_host(struct qitem *it, struct mx_hostentry *host)
host->host, host->addr, c, neterr); \
snprintf(errmsg, sizeof(errmsg), "%s [%s] did not like our %s:\n%s", \
host->host, host->addr, c, neterr); \
return (-1); \
error = -1; \
goto out; \
} else if (res != exp) { \
syslog(LOG_NOTICE, "remote delivery deferred: %s [%s] failed after %s: %s", \
host->host, host->addr, c, neterr); \
return (1); \
error = 1; \
goto out; \
}

/* Check first reply from remote host */
Expand Down Expand Up @@ -426,7 +428,8 @@ deliver_to_host(struct qitem *it, struct mx_hostentry *host)
syslog(LOG_ERR, "remote delivery failed:"
" SMTP login failed: %m");
snprintf(errmsg, sizeof(errmsg), "SMTP login to %s failed", host->host);
return (-1);
error = -1;
goto out;
}
/* SMTP login is not available, so try without */
else if (error > 0) {
Expand Down

0 comments on commit b059bcd

Please sign in to comment.