From 5c47e2f6e765a761ab9875583fede2e58ccdfa2e Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Fri, 20 Jul 2018 16:19:34 +0100 Subject: [PATCH] Fix non-EVENTS build Broken-by: c4b57fddca (cherry picked from commit 8d3dc2397dd769bf4654b0678be8d2acf0956ddd) --- src/src/transports/smtp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index 2dfb5b73a..b9382ad1c 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -1623,9 +1623,11 @@ if (!continue_hostname) string_sprintf("DANE error: tlsa lookup %s", rc == DEFER ? "DEFER" : "FAIL"), rc, FALSE); +# ifndef DISABLE_EVENT (void) event_raise(sx->tblock->event_action, US"dane:fail", sx->dane_required ? US"dane-required" : US"dnssec-invalid"); +# endif return rc; } } @@ -1634,8 +1636,10 @@ if (!continue_hostname) set_errno_nohost(sx->addrlist, ERRNO_DNSDEFER, string_sprintf("DANE error: %s lookup not DNSSEC", sx->host->name), FAIL, FALSE); +# ifndef DISABLE_EVENT (void) event_raise(sx->tblock->event_action, US"dane:fail", US"dane-required"); +# endif return FAIL; } } @@ -1974,8 +1978,10 @@ if ( smtp_peer_options & OPTION_TLS log_write(0, LOG_MAIN, "DANE attempt failed; TLS connection to %s [%s]: %s", sx->host->name, sx->host->address, errstr); +# ifndef DISABLE_EVENT (void) event_raise(sx->tblock->event_action, US"dane:fail", US"validation-failure"); /* could do with better detail */ +# endif } # endif @@ -2070,7 +2076,7 @@ else if ( sx->smtps message = string_sprintf("a TLS session is required, but %s", smtp_peer_options & OPTION_TLS ? "an attempt to start TLS failed" : "the server did not offer TLS support"); -# ifdef SUPPORT_DANE +# if defined(SUPPORT_DANE) && !defined(DISABLE_EVENT) if (sx->dane) (void) event_raise(sx->tblock->event_action, US"dane:fail", smtp_peer_options & OPTION_TLS -- 2.30.2