Mail: logging upstream to the error log with "smtp_auth none;".

Previously, it was never logged because of missing login.
This commit is contained in:
Sergey Kandaurov 2025-07-21 17:44:28 +04:00 committed by pluknet
parent 9c02c84a74
commit 239e10793a
1 changed files with 4 additions and 6 deletions

View File

@ -1006,14 +1006,12 @@ ngx_mail_log_error(ngx_log_t *log, u_char *buf, size_t len)
len -= p - buf;
buf = p;
if (s->login.len == 0) {
return p;
if (s->login.len) {
p = ngx_snprintf(buf, len, ", login: \"%V\"", &s->login);
len -= p - buf;
buf = p;
}
p = ngx_snprintf(buf, len, ", login: \"%V\"", &s->login);
len -= p - buf;
buf = p;
if (s->proxy == NULL) {
return p;
}