diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 18:56:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-08 18:56:32 +0000 |
commit | e2905c99ea172c2e54ea419699d8073d23fe7b22 (patch) | |
tree | 89ef066e2d4428688b42ec1d2f23dd28d51253b2 /src/smtpd/smtpd_sasl_glue.c | |
parent | Adding upstream version 3.7.10. (diff) | |
download | postfix-e2905c99ea172c2e54ea419699d8073d23fe7b22.tar.xz postfix-e2905c99ea172c2e54ea419699d8073d23fe7b22.zip |
Adding upstream version 3.7.11.upstream/3.7.11upstream
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. */ |