diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2020-10-31 23:58:11 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2020-11-02 14:23:32 +0000 |
commit | a75ebe0dcc5faeb915cacb0d9db66d2475789116 (patch) | |
tree | 8b84e92aef30f331707a479c368ebed41fb2e27a /src | |
parent | 51b611aa81d7ee01243b196abc34a0e2eabd293c (diff) |
Pass authenticator pubname through spool. Bug 2648
Diffstat (limited to 'src')
-rw-r--r-- | src/exim_monitor/em_globals.c | 1 | ||||
-rw-r--r-- | src/src/smtp_in.c | 12 | ||||
-rw-r--r-- | src/src/spool_in.c | 4 | ||||
-rw-r--r-- | src/src/spool_out.c | 6 |
4 files changed, 15 insertions, 8 deletions
diff --git a/src/exim_monitor/em_globals.c b/src/exim_monitor/em_globals.c index 925e88e05..30d22b5eb 100644 --- a/src/exim_monitor/em_globals.c +++ b/src/exim_monitor/em_globals.c @@ -205,6 +205,7 @@ uschar *sender_address = NULL; uschar *sender_fullhost = NULL; uschar *sender_helo_name = NULL; uschar *sender_host_address = NULL; +uschar *sender_host_auth_pubname = NULL; uschar *sender_host_authenticated = NULL; uschar *sender_host_name = NULL; int sender_host_port = 0; diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index cf6271c60..b50070cfa 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -5894,12 +5894,14 @@ if (!sender_host_authenticated) g = string_append(g, 2, US";\n\tauth=pass (", sender_host_auth_pubname); -if (Ustrcmp(sender_host_auth_pubname, "tls") != 0) - g = string_append(g, 2, US") smtp.auth=", authenticated_id); -else if (authenticated_id) - g = string_append(g, 2, US") x509.auth=", authenticated_id); +if (Ustrcmp(sender_host_auth_pubname, "tls") == 0) + g = authenticated_id + ? string_append(g, 2, US") x509.auth=", authenticated_id) + : string_cat(g, US") reason=x509.auth"); else - g = string_cat(g, US") reason=x509.auth"); + g = authenticated_id + ? string_append(g, 2, US") smtp.auth=", authenticated_id) + : string_cat(g, US", no id saved)"); if (authenticated_sender) g = string_append(g, 2, US" smtp.mailfrom=", authenticated_sender); diff --git a/src/src/spool_in.c b/src/src/spool_in.c index 7d95fccc1..022ac02bc 100644 --- a/src/src/spool_in.c +++ b/src/src/spool_in.c @@ -253,7 +253,7 @@ sender_helo_name = NULL; sender_host_address = NULL; sender_host_name = NULL; sender_host_port = 0; -sender_host_authenticated = NULL; +sender_host_authenticated = sender_host_auth_pubname = NULL; sender_ident = NULL; f.sender_local = FALSE; f.sender_set_untrusted = FALSE; @@ -580,6 +580,8 @@ for (;;) host_lookup_deferred = TRUE; else if (Ustrcmp(p, "ost_lookup_failed") == 0) host_lookup_failed = TRUE; + else if (Ustrncmp(p, "ost_auth_pubname", 16) == 0) + sender_host_auth_pubname = string_copy_taint(var + 18, tainted); else if (Ustrncmp(p, "ost_auth", 8) == 0) sender_host_authenticated = string_copy_taint(var + 10, tainted); else if (Ustrncmp(p, "ost_name", 8) == 0) diff --git a/src/src/spool_out.c b/src/src/spool_out.c index 4539e3c69..113765bab 100644 --- a/src/src/spool_out.c +++ b/src/src/spool_out.c @@ -174,9 +174,11 @@ if (sender_host_address) fprintf(fp, "-host_address %s.%d\n", sender_host_address, sender_host_port); if (sender_host_name) spool_var_write(fp, US"host_name", sender_host_name); - if (sender_host_authenticated) - spool_var_write(fp, US"host_auth", sender_host_authenticated); } +if (sender_host_authenticated) + spool_var_write(fp, US"host_auth", sender_host_authenticated); +if (sender_host_auth_pubname) + spool_var_write(fp, US"host_auth_pubname", sender_host_auth_pubname); /* Also about the interface a message came in on */ |