summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2020-06-08 11:09:44 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2020-06-11 20:30:18 +0100
commitf6fa370ab8cc56cf06e906a1a2c714d196aac81b (patch)
treeb604739aa3ad535d9604a6d3bb4b2f5f6488ac1e /src
parent0851a3bbf4667081d47f5d85b6b3a5cb33cbdba6 (diff)
GnuTLS: more info on accept zero-error
Diffstat (limited to 'src')
-rw-r--r--src/src/tls-gnu.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/src/tls-gnu.c b/src/src/tls-gnu.c
index fa489902a..eff9e8859 100644
--- a/src/src/tls-gnu.c
+++ b/src/src/tls-gnu.c
@@ -424,11 +424,14 @@ record_io_error(exim_gnutls_state_st *state, int rc, uschar *when, uschar *text)
const uschar * msg;
uschar * errstr;
-if (rc == GNUTLS_E_FATAL_ALERT_RECEIVED)
- msg = string_sprintf("A TLS fatal alert has been received: %s",
- US gnutls_alert_get_name(gnutls_alert_get(state->session)));
-else
- msg = US gnutls_strerror(rc);
+msg = rc == GNUTLS_E_FATAL_ALERT_RECEIVED
+ ? string_sprintf("A TLS fatal alert has been received: %s",
+ US gnutls_alert_get_name(gnutls_alert_get(state->session)))
+ : rc == GNUTLS_E_PREMATURE_TERMINATION && errno
+ ? errno == ECONNRESET /* Outlook does this to us right after sending us QUIT */
+ ? string_sprintf("syscall: %s", strerror(errno))
+ : string_sprintf("%s: syscall: %s", US gnutls_strerror(rc), strerror(errno))
+ : US gnutls_strerror(rc);
(void) tls_error(when, msg, state->host, &errstr);