]> git.kaiwu.me - nginx.git/commitdiff
Mail: logging upstream to the error log with "smtp_auth none;".
authorSergey Kandaurov <pluknet@nginx.com>
Mon, 21 Jul 2025 13:44:28 +0000 (17:44 +0400)
committerpluknet <pluknet@nginx.com>
Wed, 13 Aug 2025 14:20:34 +0000 (18:20 +0400)
Previously, it was never logged because of missing login.

src/mail/ngx_mail_handler.c

index d3be7f3b3b74659791f25dc403991343daca910b..a88e6c28737dab14f4d22bc4edef4296740dfe63 100644 (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;
     }