summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2015-12-14 17:28:52 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2015-12-14 17:32:29 +0000
commit0cbf2b821bb13da0268556d0e30ea627d5592c60 (patch)
tree56df546df7a2a20da8112e968be90ac88db97f38 /src
parent39755c16ba29d951df230944f652c5da9a445c0f (diff)
Events: move from Experimental to mainline
Diffstat (limited to 'src')
-rw-r--r--src/src/EDITME8
-rw-r--r--src/src/acl.c2
-rw-r--r--src/src/config.h.defaults2
-rw-r--r--src/src/deliver.c16
-rw-r--r--src/src/exim.c6
-rw-r--r--src/src/expand.c2
-rw-r--r--src/src/functions.h2
-rw-r--r--src/src/globals.c4
-rw-r--r--src/src/globals.h2
-rw-r--r--src/src/readconf.c2
-rw-r--r--src/src/smtp_out.c2
-rw-r--r--src/src/structs.h2
-rw-r--r--src/src/tls-gnu.c14
-rw-r--r--src/src/tls-openssl.c16
-rw-r--r--src/src/transport.c2
-rw-r--r--src/src/transports/smtp.c16
-rw-r--r--src/src/verify.c8
17 files changed, 53 insertions, 53 deletions
diff --git a/src/src/EDITME b/src/src/EDITME
index e10546d2c..7cdcfc93a 100644
--- a/src/src/EDITME
+++ b/src/src/EDITME
@@ -432,6 +432,10 @@ EXIM_MONITOR=eximon.bin
# DISABLE_DNSSEC=yes
+# To disable support for Events set DISABLE_EVENT to "yes"
+
+# DISABLE_EVENT=yes
+
#------------------------------------------------------------------------------
# Compiling Exim with experimental features. These are documented in
@@ -477,10 +481,6 @@ EXIM_MONITOR=eximon.bin
# LDFLAGS += -lopendmarc
-# Uncomment the following line to support Events,
-# eg. for logging to a database.
-# EXPERIMENTAL_EVENT=yes
-
# Uncomment the following line to add Redis lookup support
# You need to have hiredis installed on your system (https://github.com/redis/hiredis).
# Depending on where it is installed you may have to edit the CFLAGS and LDFLAGS lines.
diff --git a/src/src/acl.c b/src/src/acl.c
index f310a87d3..17f55c2ac 100644
--- a/src/src/acl.c
+++ b/src/src/acl.c
@@ -3744,7 +3744,7 @@ for (; cb != NULL; cb = cb->next)
{
int old_pool = store_pool;
if ( cb->u.varname[0] == 'c'
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
|| event_name /* An event is being delivered */
#endif
)
diff --git a/src/src/config.h.defaults b/src/src/config.h.defaults
index 37f47dccf..35c5559fb 100644
--- a/src/src/config.h.defaults
+++ b/src/src/config.h.defaults
@@ -43,6 +43,7 @@ it's a default value. */
#define DELIVER_OUT_BUFFER_SIZE 8192
#define DISABLE_DNSSEC
#define DISABLE_DKIM
+#define DISABLE_EVENT
#define DISABLE_PRDR
#define DISABLE_OCSP
#define DISABLE_D_OPTION
@@ -176,7 +177,6 @@ it's a default value. */
#define EXPERIMENTAL_DCC
#define EXPERIMENTAL_DSN_INFO
#define EXPERIMENTAL_DMARC
-#define EXPERIMENTAL_EVENT
#define EXPERIMENTAL_REDIS
#define EXPERIMENTAL_SPF
#define EXPERIMENTAL_SRS
diff --git a/src/src/deliver.c b/src/src/deliver.c
index 9c2839b27..d85f010e6 100644
--- a/src/src/deliver.c
+++ b/src/src/deliver.c
@@ -763,7 +763,7 @@ return s;
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
uschar *
event_raise(uschar * action, const uschar * event, uschar * ev_data)
{
@@ -829,7 +829,7 @@ deliver_localpart = save_local;
deliver_domain = save_domain;
router_name = transport_name = NULL;
}
-#endif /*EXPERIMENTAL_EVENT*/
+#endif /*DISABLE_EVENT*/
@@ -854,7 +854,7 @@ the log line, and reset the store afterwards. Remote deliveries should always
have a pointer to the host item that succeeded; local deliveries can have a
pointer to a single host item in their host list, for use by the transport. */
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
/* presume no successful remote delivery */
lookup_dnssec_authenticated = NULL;
#endif
@@ -928,7 +928,7 @@ else
if (continue_sequence > 1)
s = string_cat(s, &size, &ptr, US"*", 1);
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
deliver_host_address = addr->host_used->address;
deliver_host_port = addr->host_used->port;
deliver_host = addr->host_used->name;
@@ -999,7 +999,7 @@ store we used to build the line after writing it. */
s[ptr] = 0;
log_write(0, flags, "%s", s);
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
if (!msg) msg_event_raise(US"msg:delivery", addr);
#endif
@@ -1439,7 +1439,7 @@ else
log_write(0, LOG_MAIN, "** %s", s);
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
msg_event_raise(US"msg:fail:delivery", addr);
#endif
@@ -5862,7 +5862,7 @@ if (process_recipients != RECIP_IGNORE)
break;
}
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
if (process_recipients != RECIP_ACCEPT)
{
uschar * save_local = deliver_localpart;
@@ -7564,7 +7564,7 @@ if (!addr_defer)
/* Unset deliver_freeze so that we won't try to move the spool files further down */
deliver_freeze = FALSE;
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
(void) event_raise(event_action, US"msg:complete", NULL);
#endif
}
diff --git a/src/src/exim.c b/src/src/exim.c
index 0fd95dd0c..9e4dafe2f 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -823,6 +823,9 @@ fprintf(f, "Support for:");
#ifndef DISABLE_DNSSEC
fprintf(f, " DNSSEC");
#endif
+#ifndef DISABLE_EVENT
+ fprintf(f, " Event");
+#endif
#ifdef SUPPORT_I18N
fprintf(f, " I18N");
#endif
@@ -859,9 +862,6 @@ fprintf(f, "Support for:");
#ifdef EXPERIMENTAL_DSN_INFO
fprintf(f, " Experimental_DSN_info");
#endif
-#ifdef EXPERIMENTAL_EVENT
- fprintf(f, " Experimental_Event");
-#endif
#ifdef EXPERIMENTAL_REDIS
fprintf(f, " Experimental_Redis");
#endif
diff --git a/src/src/expand.c b/src/src/expand.c
index 55b3d8c29..f09271782 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -516,7 +516,7 @@ static var_entry var_table[] = {
{ "dnslist_value", vtype_stringptr, &dnslist_value },
{ "domain", vtype_stringptr, &deliver_domain },
{ "domain_data", vtype_stringptr, &deliver_domain_data },
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
{ "event_data", vtype_stringptr, &event_data },
/*XXX want to use generic vars for as many of these as possible*/
diff --git a/src/src/functions.h b/src/src/functions.h
index edc72bc0d..bd43934f0 100644
--- a/src/src/functions.h
+++ b/src/src/functions.h
@@ -164,7 +164,7 @@ extern BOOL dscp_lookup(const uschar *, int, int *, int *, int *);
extern void enq_end(uschar *);
extern BOOL enq_start(uschar *, unsigned);
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
extern uschar *event_raise(uschar *, const uschar *, uschar *);
extern void msg_event_raise(const uschar *, const address_item *);
#endif
diff --git a/src/src/globals.c b/src/src/globals.c
index 9ecb59652..0edb16962 100644
--- a/src/src/globals.c
+++ b/src/src/globals.c
@@ -690,7 +690,7 @@ uschar *errors_copy = NULL;
int error_handling = ERRORS_SENDER;
uschar *errors_reply_to = NULL;
int errors_sender_rc = EXIT_FAILURE;
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
uschar *event_action = NULL; /* expansion for delivery events */
uschar *event_data = NULL; /* auxilary data variable for event */
int event_defer_errno = 0;
@@ -1446,7 +1446,7 @@ transport_instance transport_defaults = {
FALSE, /* log_defer_output */
TRUE_UNSET /* retry_use_local_part: BOOL, but set neither
1 nor 0 so can detect unset */
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
,NULL /* event_action */
#endif
};
diff --git a/src/src/globals.h b/src/src/globals.h
index c969214c8..eb85eefa9 100644
--- a/src/src/globals.h
+++ b/src/src/globals.h
@@ -431,7 +431,7 @@ extern uschar *errors_copy; /* For taking copies of errors */
extern uschar *errors_reply_to; /* Reply-to for error messages */
extern int errors_sender_rc; /* Return after message to sender*/
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
extern uschar *event_action; /* expansion for delivery events */
extern uschar *event_data; /* event data */
extern int event_defer_errno; /* error number set when a remote delivery is deferred with a host error */
diff --git a/src/src/readconf.c b/src/src/readconf.c
index 8a237d38a..f2bf23bbb 100644
--- a/src/src/readconf.c
+++ b/src/src/readconf.c
@@ -251,7 +251,7 @@ static optionlist optionlist_config[] = {
{ "envelope_to_remove", opt_bool, &envelope_to_remove },
{ "errors_copy", opt_stringptr, &errors_copy },
{ "errors_reply_to", opt_stringptr, &errors_reply_to },
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
{ "event_action", opt_stringptr, &event_action },
#endif
{ "exim_group", opt_gid, &exim_gid },
diff --git a/src/src/smtp_out.c b/src/src/smtp_out.c
index da4a46f51..c55b29254 100644
--- a/src/src/smtp_out.c
+++ b/src/src/smtp_out.c
@@ -155,7 +155,7 @@ int sock;
int on = 1;
int save_errno = 0;
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
deliver_host_address = host->address;
deliver_host_port = port;
if (event_raise(tb->event_action, US"tcp:connect", NULL)) return -1;
diff --git a/src/src/structs.h b/src/src/structs.h
index 5fe8551cd..78f5a8087 100644
--- a/src/src/structs.h
+++ b/src/src/structs.h
@@ -189,7 +189,7 @@ typedef struct transport_instance {
BOOL log_fail_output;
BOOL log_defer_output;
BOOL retry_use_local_part; /* Defaults true for local, false for remote */
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
uschar *event_action; /* String to expand on notable events */
#endif
} transport_instance;
diff --git a/src/src/tls-gnu.c b/src/src/tls-gnu.c
index c2f073833..28ae46d9d 100644
--- a/src/src/tls-gnu.c
+++ b/src/src/tls-gnu.c
@@ -47,9 +47,9 @@ require current GnuTLS, then we'll drop support for the ancient libraries).
# warning "GnuTLS library version too old; define DISABLE_OCSP in Makefile"
# define DISABLE_OCSP
#endif
-#if GNUTLS_VERSION_NUMBER < 0x020a00 && defined(EXPERIMENTAL_EVENT)
+#if GNUTLS_VERSION_NUMBER < 0x020a00 && !defined(DISABLE_EVENT)
# warning "GnuTLS library version too old; tls:cert event unsupported"
-# undef EXPERIMENTAL_EVENT
+# define DISABLE_EVENT
#endif
#if GNUTLS_VERSION_NUMBER >= 0x030306
# define SUPPORT_CA_DIR
@@ -121,7 +121,7 @@ typedef struct exim_gnutls_state {
uschar *exp_tls_require_ciphers;
uschar *exp_tls_ocsp_file;
const uschar *exp_tls_verify_cert_hostnames;
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
uschar *event_action;
#endif
@@ -140,7 +140,7 @@ static const exim_gnutls_state_st exim_gnutls_state_init = {
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL,
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
NULL,
#endif
NULL,
@@ -1598,7 +1598,7 @@ return 0;
#endif
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
/*
We use this callback to get observability and detail-level control
for an exim TLS connection (either direction), raising a tls:cert event
@@ -1722,7 +1722,7 @@ else
gnutls_certificate_server_set_request(state->session, GNUTLS_CERT_IGNORE);
}
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
if (event_action)
{
state->event_action = event_action;
@@ -1953,7 +1953,7 @@ if (request_ocsp)
}
#endif
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
if (tb->event_action)
{
state->event_action = tb->event_action;
diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c
index 704522b50..3430e4eac 100644
--- a/src/src/tls-openssl.c
+++ b/src/src/tls-openssl.c
@@ -152,7 +152,7 @@ typedef struct tls_ext_ctx_cb {
/* only passed down to tls_error: */
host_item *host;
const uschar * verify_cert_hostnames;
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
uschar * event_action;
#endif
} tls_ext_ctx_cb;
@@ -282,7 +282,7 @@ for(i= 0; i<sk_X509_OBJECT_num(roots); i++)
*/
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
static int
verify_event(tls_support * tlsp, X509 * cert, int depth, const uschar * dn,
BOOL *calledp, const BOOL *optionalp, const uschar * what)
@@ -394,7 +394,7 @@ else if (depth != 0)
ERR_clear_error();
}
#endif
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
if (verify_event(tlsp, cert, depth, dn, calledp, optionalp, US"SSL"))
return 0; /* reject, with peercert set */
#endif
@@ -454,7 +454,7 @@ else
}
}
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
if (verify_event(tlsp, cert, depth, dn, calledp, optionalp, US"SSL"))
return 0; /* reject, with peercert set */
#endif
@@ -491,7 +491,7 @@ verify_callback_client_dane(int state, X509_STORE_CTX * x509ctx)
{
X509 * cert = X509_STORE_CTX_get_current_cert(x509ctx);
uschar dn[256];
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
int depth = X509_STORE_CTX_get_error_depth(x509ctx);
BOOL dummy_called, optional = FALSE;
#endif
@@ -501,7 +501,7 @@ dn[sizeof(dn)-1] = '\0';
DEBUG(D_tls) debug_printf("verify_callback_client_dane: %s\n", dn);
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
if (verify_event(&tls_out, cert, depth, dn,
&dummy_called, &optional, US"DANE"))
return 0; /* reject, with peercert set */
@@ -1284,7 +1284,7 @@ else
cbinfo->dhparam = dhparam;
cbinfo->server_cipher_list = NULL;
cbinfo->host = host;
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
cbinfo->event_action = NULL;
#endif
@@ -2112,7 +2112,7 @@ if (request_ocsp)
}
#endif
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
client_static_cbinfo->event_action = tb->event_action;
#endif
diff --git a/src/src/transport.c b/src/src/transport.c
index e77479b97..13f3c07fc 100644
--- a/src/src/transport.c
+++ b/src/src/transport.c
@@ -66,7 +66,7 @@ optionlist optionlist_transports[] = {
(void *)offsetof(transport_instance, driver_name) },
{ "envelope_to_add", opt_bool|opt_public,
(void *)(offsetof(transport_instance, envelope_to_add)) },
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
{ "event_action", opt_stringptr | opt_public,
(void *)offsetof(transport_instance, event_action) },
#endif
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index c53ae2386..135069d0f 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -683,7 +683,7 @@ msglog_line(host_item * host, uschar * message)
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
/*************************************************
* Post-defer action *
*************************************************/
@@ -919,7 +919,7 @@ while (count-- > 0)
addr->basic_errno = ERRNO_RCPT4XX;
addr->more_errno |= ((buffer[1] - '0')*10 + buffer[2] - '0') << 8;
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
event_defer_errno = addr->more_errno;
msg_event_raise(US"msg:rcpt:host:defer", addr);
#endif
@@ -930,7 +930,7 @@ while (count-- > 0)
if (host->next)
log_write(0, LOG_MAIN, "H=%s [%s]: %s", host->name, host->address, addr->message);
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
else
msg_event_raise(US"msg:rcpt:defer", addr);
#endif
@@ -1562,7 +1562,7 @@ if (continue_hostname == NULL)
#endif
if (!good_response) goto RESPONSE_FAILED;
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
{
uschar * s;
lookup_dnssec_authenticated = host->dnssec==DS_YES ? US"yes"
@@ -2458,7 +2458,7 @@ if (!ok) ok = TRUE; else
/* Set up confirmation if needed - applies only to SMTP */
if (
-#ifndef EXPERIMENTAL_EVENT
+#ifdef DISABLE_EVENT
LOGGING(smtp_confirmation) &&
#endif
!lmtp
@@ -2930,7 +2930,7 @@ case continue_more won't get set. */
(void)close(inblock.sock);
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
(void) event_raise(tblock->event_action, US"tcp:close", NULL);
#endif
@@ -3663,7 +3663,7 @@ for (cutoff_retry = 0; expired &&
first_addr->basic_errno != ERRNO_TLSFAILURE)
write_logs(first_addr, host);
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
if (rc == DEFER)
deferred_event_raise(first_addr, host);
#endif
@@ -3691,7 +3691,7 @@ for (cutoff_retry = 0; expired &&
&message_defer, TRUE);
if (rc == DEFER && first_addr->basic_errno != ERRNO_AUTHFAIL)
write_logs(first_addr, host);
-# ifdef EXPERIMENTAL_EVENT
+# ifndef DISABLE_EVENT
if (rc == DEFER)
deferred_event_raise(first_addr, host);
# endif
diff --git a/src/src/verify.c b/src/src/verify.c
index 17c99d174..b73f45a24 100644
--- a/src/src/verify.c
+++ b/src/src/verify.c
@@ -687,7 +687,7 @@ can do it there for the non-rcpt-verify case. For this we keep an addresscount.
if (!(done= smtp_read_response(&inblock, responsebuffer, sizeof(responsebuffer), '2', callout)))
goto RESPONSE_FAILED;
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
lookup_dnssec_authenticated = host->dnssec==DS_YES ? US"yes"
: host->dnssec==DS_NO ? US"no" : NULL;
if (event_raise(addr->transport->event_action,
@@ -811,7 +811,7 @@ can do it there for the non-rcpt-verify case. For this we keep an addresscount.
if (rc == DEFER)
{
(void)close(inblock.sock);
-# ifdef EXPERIMENTAL_EVENT
+# ifndef DISABLE_EVENT
(void) event_raise(addr->transport->event_action,
US"tcp:close", NULL);
# endif
@@ -1103,7 +1103,7 @@ can do it there for the non-rcpt-verify case. For this we keep an addresscount.
tls_close(FALSE, TRUE);
#endif
(void)close(inblock.sock);
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
(void) event_raise(addr->transport->event_action,
US"tcp:close", NULL);
#endif
@@ -1312,7 +1312,7 @@ can do it there for the non-rcpt-verify case. For this we keep an addresscount.
tls_close(FALSE, TRUE);
#endif
(void)close(inblock.sock);
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
(void) event_raise(addr->transport->event_action, US"tcp:close", NULL);
#endif
}