diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 10:22:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 10:22:01 +0000 |
commit | a8124680264223db14cd09a7e3a763a8309faf54 (patch) | |
tree | ea37b6dc47f4cb0d95db48b8b4569066112e1cd0 /src/smtpd/smtpd_sasl_glue.c | |
parent | Releasing progress-linux version 3.7.10-0+deb12u1~progress6.99u1. (diff) | |
download | postfix-a8124680264223db14cd09a7e3a763a8309faf54.tar.xz postfix-a8124680264223db14cd09a7e3a763a8309faf54.zip |
Merging upstream version 3.7.11.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/smtpd/smtpd_sasl_glue.c')
-rw-r--r-- | src/smtpd/smtpd_sasl_glue.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/smtpd/smtpd_sasl_glue.c b/src/smtpd/smtpd_sasl_glue.c index 2dc6aad..d9db7b0 100644 --- a/src/smtpd/smtpd_sasl_glue.c +++ b/src/smtpd/smtpd_sasl_glue.c @@ -340,18 +340,20 @@ int smtpd_sasl_authenticate(SMTPD_STATE *state, } } if (status != XSASL_AUTH_DONE) { + const char *reason = (*STR(state->sasl_reply) ? STR(state->sasl_reply) : + "(reason unavailable)"); + sasl_username = xsasl_server_get_username(state->sasl_server); msg_warn("%s: SASL %.100s authentication failed: %s, sasl_username=%.100s", - state->namaddr, sasl_method, *STR(state->sasl_reply) ? - STR(state->sasl_reply) : "(reason unavailable)", + state->namaddr, sasl_method, reason, sasl_username ? sasl_username : "(unavailable)"); /* RFC 4954 Section 6. */ if (status == XSASL_AUTH_TEMP) smtpd_chat_reply(state, "454 4.7.0 Temporary authentication failure: %s", - STR(state->sasl_reply)); + reason); else smtpd_chat_reply(state, "535 5.7.8 Error: authentication failed: %s", - STR(state->sasl_reply)); + reason); return (-1); } /* RFC 4954 Section 6. */ |