Events: move from Experimental to mainline
authorJeremy Harris <jgh146exb@wizmail.org>
Mon, 14 Dec 2015 17:28:52 +0000 (17:28 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Mon, 14 Dec 2015 17:32:29 +0000 (17:32 +0000)
26 files changed:
doc/doc-docbook/spec.xfpt
doc/doc-txt/ChangeLog
doc/doc-txt/experimental-spec.txt
src/src/EDITME
src/src/acl.c
src/src/config.h.defaults
src/src/deliver.c
src/src/exim.c
src/src/expand.c
src/src/functions.h
src/src/globals.c
src/src/globals.h
src/src/readconf.c
src/src/smtp_out.c
src/src/structs.h
src/src/tls-gnu.c
src/src/tls-openssl.c
src/src/transport.c
src/src/transports/smtp.c
src/src/verify.c
test/scripts/5700-events/REQUIRES
test/scripts/5710-GnuTLS-events/REQUIRES
test/scripts/5720-OpenSSL-events/REQUIRES
test/scripts/5730-OCSP-GnuTLS-events/5730
test/scripts/5740-OCSP-OpenSSL-events/5740
test/scripts/5860-DANE-OpenSSL-events/5860

index aabf85865adfe5dd3a30b2e5f8e46507d2e72293..13a426c001d65ab801eeb9c2fe131ff5c2e197b8 100644 (file)
@@ -13369,6 +13369,7 @@ listed in more than one group.
 
 .section "Logging" "SECID99"
 .table2
 
 .section "Logging" "SECID99"
 .table2
+.row &%event_action%&                "custom logging"
 .row &%hosts_connection_nolog%&      "exemption from connect logging"
 .row &%log_file_path%&               "override compiled-in value"
 .row &%log_selector%&                "set/unset optional logging"
 .row &%hosts_connection_nolog%&      "exemption from connect logging"
 .row &%log_file_path%&               "override compiled-in value"
 .row &%log_selector%&                "set/unset optional logging"
@@ -14522,6 +14523,14 @@ own &'Reply-To:'& header line, the value of the &%errors_reply_to%& option is
 not used.
 
 
 not used.
 
 
+.new
+.option event_action main string&!! unset
+.cindex events
+This option declares a string to be expanded for Exim's events mechanism.
+For details see &<<CHAPevents>>&.
+.wen
+
+
 .option exim_group main string "compile-time configured"
 .cindex "gid (group id)" "Exim's own"
 .cindex "Exim group"
 .option exim_group main string "compile-time configured"
 .cindex "gid (group id)" "Exim's own"
 .cindex "Exim group"
@@ -20556,6 +20565,13 @@ its removal from incoming messages, so that delivered messages can safely be
 resent to other recipients.
 
 
 resent to other recipients.
 
 
+.option event_action transports string&!! unset
+.cindex events
+This option declares a string to be expanded for Exim's events mechanism.
+For details see &<<CHAPevents>>&.
+.wen
+
+
 .option group transports string&!! "Exim group"
 .cindex "transport" "group; specifying"
 This option specifies a gid for running the transport process, overriding any
 .option group transports string&!! "Exim group"
 .cindex "transport" "group; specifying"
 This option specifies a gid for running the transport process, overriding any
@@ -37834,7 +37850,7 @@ be tracked on a per-domain basis, rather than merely upon source IP address.
 DKIM is documented in RFC 4871.
 
 Since version 4.70, DKIM support is compiled into Exim by default. It can be
 DKIM is documented in RFC 4871.
 
 Since version 4.70, DKIM support is compiled into Exim by default. It can be
-disabled by setting DISABLE_DKIM=yes in Local/Makefile.
+disabled by setting DISABLE_DKIM=yes in &_Local/Makefile_&.
 
 Exim's DKIM implementation allows to
 .olist
 
 Exim's DKIM implementation allows to
 .olist
@@ -38370,6 +38386,121 @@ must be representable in UTF-16.
 . ////////////////////////////////////////////////////////////////////////////
 . ////////////////////////////////////////////////////////////////////////////
 
 . ////////////////////////////////////////////////////////////////////////////
 . ////////////////////////////////////////////////////////////////////////////
 
+.chapter "Events" "CHAPevents" &&&
+         "Events"
+.cindex events
+
+.new
+The events mechanism in Exim can be used to intercept processing at a number
+of points.  It was originally invented to giave a way to do customised logging
+actions (for example, to a database) but can also be used to modify some
+processing actions.
+
+Most installations will never need to use Events.
+The support can be left out of a build by defining DISABLE_EVENT=yes
+in &_Local/Makefile_&.
+
+There are two major classes of events: main and transport.
+The main configuration option &%event_action%& controls reception events;
+a transport option &%event_action%& controls delivery events.
+
+Both options are a string which is expanded when the event fires.
+An example might look like:
+.cindex logging custom
+.code
+event_action = ${if eq {msg:delivery}{$event_name} \
+{${lookup pgsql {SELECT * FROM record_Delivery( \
+    '${quote_pgsql:$sender_address_domain}',\
+    '${quote_pgsql:${lc:$sender_address_local_part}}', \
+    '${quote_pgsql:$domain}', \
+    '${quote_pgsql:${lc:$local_part}}', \
+    '${quote_pgsql:$host_address}', \
+    '${quote_pgsql:${lc:$host}}', \
+    '${quote_pgsql:$message_exim_id}')}} \
+} {}}
+.endd
+
+Events have names which correspond to the point in process at which they fire.
+The name is placed in the variable &$event_name$& and the event action
+expansion must check this, as it will be called for every possible event type.
+
+The current list of events is:
+.display
+&`msg:complete           after    main       `& per message
+&`msg:delivery           after    transport  `& per recipient
+&`msg:rcpt:host:defer    after    transport  `& per recipient per host
+&`msg:rcpt:defer         after    transport  `& per recipient
+&`msg:host:defer         after    transport  `& per attempt
+&`msg:fail:delivery      after    main       `& per recipient
+&`msg:fail:internal      after    main       `& per recipient
+&`tcp:connect            before   transport  `& per connection
+&`tcp:close              after    transport  `& per connection
+&`tls:cert               before   both       `& per certificate in verification chain
+&`smtp:connect           after    transport  `& per connection
+.endd
+New event types may be added in future.
+
+The event name is a colon-separated list, defining the type of
+event in a tree of possibilities.  It may be used as a list
+or just matched on as a whole.  There will be no spaces in the name.
+
+The second column in the table above describes whether the event fires
+before or after the action is associates with.  Those which fire before
+can be used to affect that action (more on this below).
+
+An additional variable, &$event_data$&, is filled with information varying
+with the event type:
+.display
+&`msg:delivery         `& smtp confirmation mssage
+&`msg:rcpt:host:defer  `& error string
+&`msg:rcpt:defer       `& error string
+&`msg:host:defer       `& error string
+&`tls:cert             `& verification chain depth
+&`smtp:connect         `& smtp banner
+.endd
+
+The :defer events populate one extra variable: &$event_defer_errno$&.
+
+For complex operations an ACL expansion can be used in &%event_action%&
+however due to the multiple contextx that Exim operates in during
+the course of its processing:
+.ilist
+variables set in transport events will not be visible outside that
+transport call
+.next
+acl_m variables in a server context are lost on a new connection,
+and after smtp helo/ehlo/mail/starttls/rset commands
+.endlist
+Using an ACL expansion with the logwrite modifier can be
+a useful way of writing to the main log.
+
+The expansion of the event_action option should normally
+return an empty string.  Should it return anything else the
+following will be forced:
+.display
+&`msg:delivery     `&  (ignored)
+&`msg:host:defer   `&  (ignored)
+&`msg:fail:delivery`&  (ignored)
+&`tcp:connect      `&  do not connect
+&`tcp:close        `&  (ignored)
+&`tls:cert         `&  refuse verification
+&`smtp:connect     `&  close connection
+.endd
+No other use is made of the result string.
+
+For a tcp:connect event, if the connection is being made to a proxy
+then the address and port variables will be that of the proxy and not
+the target system.
+
+For tls:cert events, if GnuTLS is in use this will trigger only per
+chain element received on the connection.
+For OpenSSL it will trigger for every chain element including those
+loaded locally.
+.wen
+
+. ////////////////////////////////////////////////////////////////////////////
+. ////////////////////////////////////////////////////////////////////////////
+
 .chapter "Adding new drivers or lookup types" "CHID13" &&&
          "Adding drivers or lookups"
 .cindex "adding drivers"
 .chapter "Adding new drivers or lookup types" "CHID13" &&&
          "Adding drivers or lookups"
 .cindex "adding drivers"
index 98755b60a9a4a829ca1f0fdfc6d9183c32a6737f..0524951503c8f270432b57176a991635af6878e5 100644 (file)
@@ -126,6 +126,9 @@ JH/27 Move Internationalisation support from Experimental to mainline, enabled
 JH/28 Bug 1745: Fix redis lookups to handle (quoted) spaces embedded in parts
       of the query string, and make ${quote_redis:} do that quoting.
 
 JH/28 Bug 1745: Fix redis lookups to handle (quoted) spaces embedded in parts
       of the query string, and make ${quote_redis:} do that quoting.
 
+JH/29 Move Events support from Experimental to mainline, enabled by default
+      and removable for a build by defining DISABLE_EVENT.
+
 
 Exim version 4.86
 -----------------
 
 Exim version 4.86
 -----------------
index aa4cb464d12c40ffe8b45e9b5bdb05b005214d15..81acfda5ef0bdb8dcf355be1ea1e3991751f5702 100644 (file)
@@ -771,125 +771,6 @@ b. Configure, somewhere before the DATA ACL, the control option to
 
 
 
 
 
 
-Event Actions
---------------------------------------------------------------
-
-(Renamed from TPDA, Transport post-delivery actions)
-
-An arbitrary per-transport string can be expanded upon various transport events.
-Additionally a main-section configuration option can be expanded on some
-per-message events.
-This feature may be used, for example, to write exim internal log information
-(not available otherwise) into a database.
-
-In order to use the feature, you must compile with
-
-EXPERIMENTAL_EVENT=yes
-
-in your Local/Makefile
-
-and define one or both of
-- the event_action option in the transport
-- the event_action main option
-to be expanded when the event fires.
-
-A new variable, $event_name, is set to the event type when the
-expansion is done.  The current list of events is:
-
- msg:complete          after  main       per message
- msg:delivery          after  transport  per recipient
- msg:rcpt:host:defer   after  transport  per recipient per host
- msg:rcpt:defer        after  transport  per recipient
- msg:host:defer                after  transport  per attempt
- msg:fail:delivery     after  main       per recipient
- msg:fail:internal     after  main       per recipient
- tcp:connect           before transport  per connection
- tcp:close             after  transport  per connection
- tls:cert              before both       per certificate in verification chain
- smtp:connect          after  transport  per connection
-
-The expansion is called for all event types, and should use the $event_name
-variable to decide when to act.  The value of the variable is a colon-separated
-list, defining a position in the tree of possible events; it may be used as
-a list or just matched on as a whole.  There will be no whitespace.
-
-New event types may be added in the future.
-
-
-There is an auxilary variable, $event_data, for which the
-content is event_dependent:
-
-       msg:delivery            smtp confirmation mssage
-       msg:rcpt:host:defer     error string
-       msg:rcpt:defer          error string
-       msg:host:defer          error string
-       tls:cert                verification chain depth
-       smtp:connect            smtp banner
-
-The :defer events populate one extra variable, $event_defer_errno.
-
-The following variables are likely to be useful depending on the event type:
-
-       router_name, transport_name
-       local_part, domain
-       host, host_address, host_port
-       tls_out_peercert
-       lookup_dnssec_authenticated, tls_out_dane
-       sending_ip_address, sending_port
-       message_exim_id, verify_mode
-
-
-An example might look like:
-
-event_action = ${if eq {msg:delivery}{$event_name} \
-{${lookup pgsql {SELECT * FROM record_Delivery( \
-    '${quote_pgsql:$sender_address_domain}',\
-    '${quote_pgsql:${lc:$sender_address_local_part}}', \
-    '${quote_pgsql:$domain}', \
-    '${quote_pgsql:${lc:$local_part}}', \
-    '${quote_pgsql:$host_address}', \
-    '${quote_pgsql:${lc:$host}}', \
-    '${quote_pgsql:$message_exim_id}')}} \
-} {}}
-
-The string is expanded when each of the supported events occur
-and any side-effects of the expansion will happen.
-
-Note that for complex operations an ACL expansion can be used,
-however due to the multiple contexts the Exim operates in
-a) variables set in events raised from transports will not
-   be visible outside that transport call.
-b) acl_m variables in a server context are lost on a new connection,
-   and after helo/ehlo/mail/starttls/rset commands
-Using an ACL expansion with the logwrite modifier can be a
-useful way of writing to the main log.
-
-
-
-The expansion of the event_action option should normally
-return an empty string.  Should it return anything else the
-following will be forced:
-
-       msg:delivery    (ignored)
-       msg:host:defer  (ignored)
-       msg:fail:delivery (ignored)
-       tcp:connect     do not connect
-       tcp:close       (ignored)
-       tls:cert        refuse verification
-       smtp:connect    close connection
-
-No other use is made of the result string.
-
-If transport proxying is used, the remote IP/port during a
-tcp:connect event will be that of the proxy.
-
-
-Known issues:
-- the tls:cert event is only called for the cert chain elements
-  received over the wire, with GnuTLS.  OpenSSL gives the entire
-  chain including those loaded locally.
-
-
 Redis Lookup
 --------------------------------------------------------------
 
 Redis Lookup
 --------------------------------------------------------------
 
index e10546d2c0c460df8012e82a04e89a4a06af591b..7cdcfc93a52f2127b157688666a5873b89627a6e 100644 (file)
@@ -432,6 +432,10 @@ EXIM_MONITOR=eximon.bin
 
 # DISABLE_DNSSEC=yes
 
 
 # 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
 
 #------------------------------------------------------------------------------
 # Compiling Exim with experimental features. These are documented in
@@ -477,10 +481,6 @@ EXIM_MONITOR=eximon.bin
 # LDFLAGS += -lopendmarc
 
 
 # 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.
 # 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.
index f310a87d359aa66c23693c63c1c64ba1d32b5e78..17f55c2acf0553bfb9012fead09b8e5142bbcbc2 100644 (file)
@@ -3744,7 +3744,7 @@ for (; cb != NULL; cb = cb->next)
       {
       int old_pool = store_pool;
       if (  cb->u.varname[0] == 'c'
       {
       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
         )
         || event_name          /* An event is being delivered */
 #endif
         )
index 37f47dccfc623e18bbe0f131109f89efb823f890..35c5559fba0bd69cb2104b1801f18c16b86e03d8 100644 (file)
@@ -43,6 +43,7 @@ it's a default value. */
 #define DELIVER_OUT_BUFFER_SIZE    8192
 #define DISABLE_DNSSEC
 #define DISABLE_DKIM
 #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
 #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_DCC
 #define EXPERIMENTAL_DSN_INFO
 #define EXPERIMENTAL_DMARC
-#define EXPERIMENTAL_EVENT
 #define EXPERIMENTAL_REDIS
 #define EXPERIMENTAL_SPF
 #define EXPERIMENTAL_SRS
 #define EXPERIMENTAL_REDIS
 #define EXPERIMENTAL_SPF
 #define EXPERIMENTAL_SRS
index 9c2839b27b542ca11268c47d838893e4b9311a5c..d85f010e61d2fe8a5ba4f2fa5666009964703fbf 100644 (file)
@@ -763,7 +763,7 @@ return s;
 
 
 
 
 
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
 uschar *
 event_raise(uschar * action, const uschar * event, uschar * ev_data)
 {
 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;
 }
 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. */
 
 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
   /* 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);
 
     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;
     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);
 
 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
 
 if (!msg) msg_event_raise(US"msg:delivery", addr);
 #endif
 
@@ -1439,7 +1439,7 @@ else
 
   log_write(0, LOG_MAIN, "** %s", s);
 
 
   log_write(0, LOG_MAIN, "** %s", s);
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
   msg_event_raise(US"msg:fail:delivery", addr);
 #endif
 
   msg_event_raise(US"msg:fail:delivery", addr);
 #endif
 
@@ -5862,7 +5862,7 @@ if (process_recipients != RECIP_IGNORE)
         break;
         }
 
         break;
         }
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
       if (process_recipients != RECIP_ACCEPT)
        {
        uschar * save_local =  deliver_localpart;
       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;
 
   /* 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
   }
   (void) event_raise(event_action, US"msg:complete", NULL);
 #endif
   }
index 0fd95dd0cbc795c9ba7c16968851ac709ba258e3..9e4dafe2f22ca5ae86e921db5a4788ea85f148b0 100644 (file)
@@ -823,6 +823,9 @@ fprintf(f, "Support for:");
 #ifndef DISABLE_DNSSEC
   fprintf(f, " DNSSEC");
 #endif
 #ifndef DISABLE_DNSSEC
   fprintf(f, " DNSSEC");
 #endif
+#ifndef DISABLE_EVENT
+  fprintf(f, " Event");
+#endif
 #ifdef SUPPORT_I18N
   fprintf(f, " I18N");
 #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_DSN_INFO
   fprintf(f, " Experimental_DSN_info");
 #endif
-#ifdef EXPERIMENTAL_EVENT
-  fprintf(f, " Experimental_Event");
-#endif
 #ifdef EXPERIMENTAL_REDIS
   fprintf(f, " Experimental_Redis");
 #endif
 #ifdef EXPERIMENTAL_REDIS
   fprintf(f, " Experimental_Redis");
 #endif
index 55b3d8c293c9c1ec5008890c3a9640855cf81767..f09271782622ef221e0c05634ba49b09937736ea 100644 (file)
@@ -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 },
   { "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*/
   { "event_data",          vtype_stringptr,   &event_data },
 
   /*XXX want to use generic vars for as many of these as possible*/
index edc72bc0d9907731a62279af30c6956fe546b7d1..bd43934f040ba22cc94f42105c6e31b9f55b15ea 100644 (file)
@@ -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);
 
 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
 extern uschar *event_raise(uschar *, const uschar *, uschar *);
 extern void    msg_event_raise(const uschar *, const address_item *);
 #endif
index 9ecb596525853e2691ca7d13f1483bcb592ab83d..0edb169623afb9463fee8b013ee2a948cff4649c 100644 (file)
@@ -690,7 +690,7 @@ uschar *errors_copy            = NULL;
 int     error_handling         = ERRORS_SENDER;
 uschar *errors_reply_to        = NULL;
 int     errors_sender_rc       = EXIT_FAILURE;
 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;
 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 */
     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
 };
    ,NULL                     /* event_action */
 #endif
 };
index c969214c8b1e96862ef9b5b31905882ed33457f6..eb85eefa9d1a5ec0569940e2c0534d39708c81bb 100644 (file)
@@ -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*/
 
 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 */
 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 */
index 8a237d38a06afacf27b2a1f60d7fae2f6001ea1e..f2bf23bbbe1a674efd4ef4576f9e16c697d31b2d 100644 (file)
@@ -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 },
   { "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 },
   { "event_action",             opt_stringptr,   &event_action },
 #endif
   { "exim_group",               opt_gid,         &exim_gid },
index da4a46f512122d3754dab032841b7a83d5c81d75..c55b29254069cbef0b0aa812d7bde3555d36a862 100644 (file)
@@ -155,7 +155,7 @@ int sock;
 int on = 1;
 int save_errno = 0;
 
 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;
 deliver_host_address = host->address;
 deliver_host_port = port;
 if (event_raise(tb->event_action, US"tcp:connect", NULL)) return -1;
index 5fe8551cdc96f36f7298672d80468ac4eaf156bd..78f5a80873270d52e12b246c0a7edc8f9955ae3c 100644 (file)
@@ -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 */
   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;
   uschar  *event_action;          /* String to expand on notable events */
 #endif
 } transport_instance;
index c2f073833b74bc2d566ef43af334dffe067a0b1d..28ae46d9d1a5450ab68012d109a10ddd61482e07 100644 (file)
@@ -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
 # 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"
 # 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
 #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;
   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
 
   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,
   NULL, NULL, NULL, NULL, NULL, NULL,
   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
   NULL,
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
                                             NULL,
 #endif
   NULL,
                                             NULL,
 #endif
   NULL,
@@ -1598,7 +1598,7 @@ return 0;
 #endif
 
 
 #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
 /*
 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);
   }
 
   gnutls_certificate_server_set_request(state->session, GNUTLS_CERT_IGNORE);
   }
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
 if (event_action)
   {
   state->event_action = event_action;
 if (event_action)
   {
   state->event_action = event_action;
@@ -1953,7 +1953,7 @@ if (request_ocsp)
   }
 #endif
 
   }
 #endif
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
 if (tb->event_action)
   {
   state->event_action = tb->event_action;
 if (tb->event_action)
   {
   state->event_action = tb->event_action;
index 704522b5005644067f028a56db34e1238fe8af96..3430e4eacef18d80736f7bab2d8c5d35e8e66bdb 100644 (file)
@@ -152,7 +152,7 @@ typedef struct tls_ext_ctx_cb {
   /* only passed down to tls_error: */
   host_item *host;
   const uschar * verify_cert_hostnames;
   /* 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;
   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)
 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
       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
     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
   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];
 {
 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
 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);
 
 
 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 */
   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;
 cbinfo->dhparam = dhparam;
 cbinfo->server_cipher_list = NULL;
 cbinfo->host = host;
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
 cbinfo->event_action = NULL;
 #endif
 
 cbinfo->event_action = NULL;
 #endif
 
@@ -2112,7 +2112,7 @@ if (request_ocsp)
   }
 #endif
 
   }
 #endif
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
 client_static_cbinfo->event_action = tb->event_action;
 #endif
 
 client_static_cbinfo->event_action = tb->event_action;
 #endif
 
index e77479b971b365610c3410164531befb6c99dd90..13f3c07fcfc34b214bf8256fe4cc567818f2afd3 100644 (file)
@@ -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)) },
                  (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
   { "event_action",     opt_stringptr | opt_public,
                  (void *)offsetof(transport_instance, event_action) },
 #endif
index c53ae2386aa74fca3fe4ccdb7bb1b52b6d7d3554..135069d0f189e487f2cfb304dd155f59c4f9244a 100644 (file)
@@ -683,7 +683,7 @@ msglog_line(host_item * host, uschar * message)
 
 
 
 
 
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
 /*************************************************
 *   Post-defer action                            *
 *************************************************/
 /*************************************************
 *   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;
 
       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
       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);
 
       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
       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;
 
 #endif
     if (!good_response) goto RESPONSE_FAILED;
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
       {
       uschar * s;
       lookup_dnssec_authenticated = host->dnssec==DS_YES ? US"yes"
       {
       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 (
     /* Set up confirmation if needed - applies only to SMTP */
 
     if (
-#ifndef EXPERIMENTAL_EVENT
+#ifdef DISABLE_EVENT
           LOGGING(smtp_confirmation) &&
 #endif
           !lmtp
           LOGGING(smtp_confirmation) &&
 #endif
           !lmtp
@@ -2930,7 +2930,7 @@ case continue_more won't get set. */
 
 (void)close(inblock.sock);
 
 
 (void)close(inblock.sock);
 
-#ifdef EXPERIMENTAL_EVENT
+#ifndef DISABLE_EVENT
 (void) event_raise(tblock->event_action, US"tcp:close", NULL);
 #endif
 
 (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);
 
                          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
       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);
           &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
         if (rc == DEFER)
           deferred_event_raise(first_addr, host);
 # endif
index 17c99d174ebd6428abbc09da7155fb02e68eee86..b73f45a2451bd18bfbf5fde0c1f70ae5c431036a 100644 (file)
@@ -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;
 
       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,
       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);
          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
            (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);
            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
            (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);
       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
       }
       (void) event_raise(addr->transport->event_action, US"tcp:close", NULL);
 #endif
       }
index 33cd625a3aa956404afbf4b0af376b0963402332..372ee1474d89748d553da23e660ec0112e8735fb 100644 (file)
@@ -1 +1 @@
-support Experimental_Event
+support Event
index 66a85d78983686334bd8a35a40019cc4272ba0c9..2b3a58b0c33c053d781d31104762505cb9eafed5 100644 (file)
@@ -1,2 +1,2 @@
-support Experimental_Event
+support Event
 support GnuTLS
 support GnuTLS
index d87b2875d966c850f9be4c492a0fad6a0ad32d68..b22bfa5bd9cdb0b9d9b3542dd0962a002ac8138d 100644 (file)
@@ -1,2 +1,2 @@
-support Experimental_Event
+support Event
 support OpenSSL
 support OpenSSL
index 759810613feddf5f93d8990ecf75ea6f6f4383cf..6085a361ef32b9fc1ea8235a0e8e77ffc0600b3f 100644 (file)
@@ -1,4 +1,4 @@
-# OCSP stapling, client, tpda
+# OCSP stapling, client, events
 # duplicate of 5651
 #
 #
 # duplicate of 5651
 #
 #
index 8010507dc07cd719661f7fbc3f6b590d1aefad37..5e385afa33b78448f860b1161f2a5e755be1ae97 100644 (file)
@@ -1,4 +1,4 @@
-# OCSP stapling, client, tpda
+# OCSP stapling, client, events
 # duplicate of 5601
 #
 #
 # duplicate of 5601
 #
 #
index 94bc4d2b83f7cbd377c5901b25ea93a7ead34c04..730c40f498dca1947192d324570508d3e232f6e4 100644 (file)
@@ -1,4 +1,4 @@
-# DANE client: TPDA
+# DANE client: events
 #
 exim -DSERVER=server -DDETAILS=ee -bd -oX PORT_D
 ****
 #
 exim -DSERVER=server -DDETAILS=ee -bd -oX PORT_D
 ****