diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2016-05-16 19:58:20 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2016-05-16 19:58:20 +0100 |
commit | fc16abb4d06c7ae375b227bd83473412c8985c6f (patch) | |
tree | f5b3332573a250826efe59249aa222e3e13c2fda /src | |
parent | 2d5fdd539c5abd1d180dfb476ef87ae3332285ed (diff) |
Logging: dnssec status on accept & delivery lines
Diffstat (limited to 'src')
-rw-r--r-- | src/src/deliver.c | 22 | ||||
-rw-r--r-- | src/src/globals.c | 1 | ||||
-rw-r--r-- | src/src/macros.h | 13 | ||||
-rw-r--r-- | src/src/receive.c | 11 | ||||
-rw-r--r-- | src/src/smtp_in.c | 16 |
5 files changed, 38 insertions, 25 deletions
diff --git a/src/src/deliver.c b/src/src/deliver.c index 743fc83e8..1421852aa 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -711,25 +711,31 @@ return s; static uschar * -d_hostlog(uschar *s, int *sizep, int *ptrp, address_item *addr) +d_hostlog(uschar * s, int * sp, int * pp, address_item * addr) { -s = string_append(s, sizep, ptrp, 5, US" H=", addr->host_used->name, - US" [", addr->host_used->address, US"]"); +host_item * h = addr->host_used; + +s = string_append(s, sp, pp, 2, US" H=", h->name); + +if (LOGGING(dnssec) && h->dnssec == DS_YES) + s = string_cat(s, sp, pp, US" DS"); + +s = string_append(s, sp, pp, 3, US" [", h->address, US"]"); + if (LOGGING(outgoing_port)) - s = string_append(s, sizep, ptrp, 2, US":", string_sprintf("%d", - addr->host_used->port)); + s = string_append(s, sp, pp, 2, US":", string_sprintf("%d", h->port)); #ifdef SUPPORT_SOCKS if (LOGGING(proxy) && proxy_local_address) { - s = string_append(s, sizep, ptrp, 3, US" PRX=[", proxy_local_address, US"]"); + s = string_append(s, sp, pp, 3, US" PRX=[", proxy_local_address, US"]"); if (LOGGING(outgoing_port)) - s = string_append(s, sizep, ptrp, 2, US":", string_sprintf("%d", + s = string_append(s, sp, pp, 2, US":", string_sprintf("%d", proxy_local_port)); } #endif -return d_log_interface(s, sizep, ptrp); +return d_log_interface(s, sp, pp); } diff --git a/src/src/globals.c b/src/src/globals.c index be1fae849..0586fdd98 100644 --- a/src/src/globals.c +++ b/src/src/globals.c @@ -864,6 +864,7 @@ bit_table log_options[] = { /* must be in alphabetical order */ BIT_TABLE(L, deliver_time), BIT_TABLE(L, delivery_size), BIT_TABLE(L, dnslist_defer), + BIT_TABLE(L, dnssec), BIT_TABLE(L, etrn), BIT_TABLE(L, host_lookup_failed), BIT_TABLE(L, ident_timeout), diff --git a/src/src/macros.h b/src/src/macros.h index 275458b8f..53abeb5c2 100644 --- a/src/src/macros.h +++ b/src/src/macros.h @@ -446,15 +446,19 @@ enum { LOG_BIT(smtp_protocol_error), LOG_BIT(smtp_syntax_error), - Li_acl_warn_skipped = BITWORDSIZE, + Li_8bitmime = BITWORDSIZE, + Li_acl_warn_skipped, Li_arguments, Li_deliver_time, Li_delivery_size, + Li_dnssec, Li_ident_timeout, Li_incoming_interface, Li_incoming_port, + Li_outgoing_interface, Li_outgoing_port, Li_pid, + Li_proxy, Li_queue_time, Li_queue_time_overall, Li_received_sender, @@ -464,6 +468,7 @@ enum { Li_sender_on_delivery, Li_sender_verify_fail, Li_smtp_confirmation, + Li_smtp_mailauth, Li_smtp_no_mail, Li_subject, Li_tls_certificate_verified, @@ -471,12 +476,8 @@ enum { Li_tls_peerdn, Li_tls_sni, Li_unknown_in_list, - Li_8bitmime, - Li_smtp_mailauth, - Li_proxy, - Li_outgoing_interface, - log_selector_size = BITWORD(Li_outgoing_interface) + 1 + log_selector_size = BITWORD(Li_unknown_in_list) + 1 }; #define LOGGING(opt) BIT_TEST(log_selector, log_selector_size, Li_##opt) diff --git a/src/src/receive.c b/src/src/receive.c index 2628570d8..92ec2cd87 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -1123,16 +1123,17 @@ Returns: the extended string */ static uschar * -add_host_info_for_log(uschar *s, int *sizeptr, int *ptrptr) +add_host_info_for_log(uschar * s, int * sizeptr, int * ptrptr) { -if (sender_fullhost != NULL) +if (sender_fullhost) { + if (LOGGING(dnssec) && sender_host_dnssec) /*XXX sender_helo_dnssec? */ + s = string_cat(s, sizeptr, ptrptr, US" DS"); s = string_append(s, sizeptr, ptrptr, 2, US" H=", sender_fullhost); if (LOGGING(incoming_interface) && interface_address != NULL) { - uschar *ss = string_sprintf(" I=[%s]:%d", interface_address, - interface_port); - s = string_cat(s, sizeptr, ptrptr, ss); + s = string_cat(s, sizeptr, ptrptr, + string_sprintf(" I=[%s]:%d", interface_address, interface_port)); } } if (sender_ident != NULL) diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 1398e620b..d66b59e30 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -2837,14 +2837,18 @@ is closing if required and return 2. */ if (log_reject_target != 0) { #ifdef SUPPORT_TLS - uschar * s = s_tlslog(NULL, NULL, NULL); - if (!s) s = US""; + uschar * tls = s_tlslog(NULL, NULL, NULL); + if (!tls) tls = US""; #else - uschar * s = US""; + uschar * tls = US""; #endif - log_write(0, log_reject_target, "%s%s %s%srejected %s%s", - host_and_ident(TRUE), s, - sender_info, (rc == FAIL)? US"" : US"temporarily ", what, log_msg); + log_write(0, log_reject_target, "%s%s%s %s%srejected %s%s", + LOGGING(dnssec) && sender_host_dnssec ? US" DS" : US"", + host_and_ident(TRUE), + tls, + sender_info, + rc == FAIL ? US"" : US"temporarily ", + what, log_msg); } if (!drop) return 0; |