[exim-cvs] Events: Fire msg:fail:delivery event even when er…

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Events: Fire msg:fail:delivery event even when error is being ignored. Bug 2314
Gitweb: https://git.exim.org/exim.git/commitdiff/ffbc20ed9c9ed09a68ff0a608f623c3c83d521a8
Commit:     ffbc20ed9c9ed09a68ff0a608f623c3c83d521a8
Parent:     eb58ddf5828a161dec94f131ff2c5c926c868354
Author:     Matthias Kurz <m.kurz@???>
AuthorDate: Fri Sep 28 19:04:55 2018 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Fri Sep 28 19:07:00 2018 +0100


    Events:  Fire msg:fail:delivery event even when error is being ignored.  Bug 2314
---
 doc/doc-txt/ChangeLog                           |  5 ++
 src/src/deliver.c                               | 18 ++++--
 test/aux-fixed/5702.filter                      |  3 +
 test/aux-fixed/5703.filter                      |  3 +
 test/{confs/5700 => aux-fixed/event-logger-acl} | 51 +----------------
 test/confs/5700                                 | 75 +------------------------
 test/confs/5701                                 | 40 +++++++++++++
 test/confs/5702                                 | 43 ++++++++++++++
 test/confs/5703                                 | 43 ++++++++++++++
 test/log/5700                                   |  6 +-
 test/log/5701                                   | 20 +++++++
 test/log/5702                                   | 20 +++++++
 test/log/5703                                   | 32 +++++++++++
 test/scripts/5700-events/5700                   |  2 +-
 test/scripts/5700-events/5701                   | 19 +++++++
 test/scripts/5700-events/5702                   | 26 +++++++++
 test/scripts/5700-events/5703                   | 20 +++++++
 test/stdout/5700                                |  4 +-
 test/stdout/5702                                | 31 ++++++++++
 test/stdout/5703                                | 17 ++++++
 20 files changed, 346 insertions(+), 132 deletions(-)


diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 8d64dd4..0f50318 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -129,6 +129,11 @@ JH/27 Fix logging of proxy address.  Previously, a pointless "PRX=[]:0" would be
       included in delivery lines for non-proxied connections, when compiled with
       SUPPORT_SOCKS and running with proxy logging enabled.


+JH/28 Bug 2314: Fire msg:fail:delivery event even when error is being ignored.
+      Developement by Matthias Kurz, tweaked by JH.  While in that bit of code,
+      move the existing event to fire before the normal logging of message
+      failure so that custom logging is bracketed by normal logging.
+


 Exim version 4.91
 -----------------
diff --git a/src/src/deliver.c b/src/src/deliver.c
index 9ab7402..bba343c 100644
--- a/src/src/deliver.c
+++ b/src/src/deliver.c
@@ -890,6 +890,7 @@ deliver_host =   addr->host_used ? addr->host_used->name : NULL;
       addr->host_used
           || Ustrcmp(addr->transport->driver_name, "smtp") == 0
       || Ustrcmp(addr->transport->driver_name, "lmtp") == 0
+      || Ustrcmp(addr->transport->driver_name, "autoreply") == 0
      ? addr->message : NULL);


 deliver_host_port =    save_port;
@@ -1383,6 +1384,16 @@ failure_log(address_item * addr, uschar * driver_kind, uschar * now)
 void * reset_point;
 gstring * g = reset_point = string_get(256);


+#ifndef DISABLE_EVENT
+/* Message failures for which we will send a DSN get their event raised
+later so avoid doing it here. */
+
+if ( !addr->prop.ignore_error
+ && !(addr->dsn_flags & (rf_dsnflags & ~rf_notify_failure))
+ )
+ msg_event_raise(US"msg:fail:delivery", addr);
+#endif
+
/* Build up the log line for the message and main logs */

/* Create the address string for logging. Must not do this earlier, because
@@ -1431,10 +1442,6 @@ else

log_write(0, LOG_MAIN, "** %s", g->s);

-#ifndef DISABLE_EVENT
-msg_event_raise(US"msg:fail:delivery", addr);
-#endif
-
 store_reset(reset_point);
 return;
 }
@@ -7445,6 +7452,9 @@ while (addr_failed)
     addr_failed = addr->next;
     if (addr->return_filename) Uunlink(addr->return_filename);


+#ifndef DISABLE_EVENT
+    msg_event_raise(US"msg:fail:delivery", addr);
+#endif
     log_write(0, LOG_MAIN, "%s%s%s%s: error ignored",
       addr->address,
       !addr->parent ? US"" : US" <",
diff --git a/test/aux-fixed/5702.filter b/test/aux-fixed/5702.filter
new file mode 100644
index 0000000..283d823
--- /dev/null
+++ b/test/aux-fixed/5702.filter
@@ -0,0 +1,3 @@
+# Exim filter
+
+unseen noerror deliver usery@domain1
diff --git a/test/aux-fixed/5703.filter b/test/aux-fixed/5703.filter
new file mode 100644
index 0000000..3083624
--- /dev/null
+++ b/test/aux-fixed/5703.filter
@@ -0,0 +1,3 @@
+# Exim filter
+
+deliver usery@domain1
diff --git a/test/confs/5700 b/test/aux-fixed/event-logger-acl
similarity index 77%
copy from test/confs/5700
copy to test/aux-fixed/event-logger-acl
index e1ce38e..62cba32 100644
--- a/test/confs/5700
+++ b/test/aux-fixed/event-logger-acl
@@ -1,20 +1,3 @@
-# Exim test configuration 5700
-
-.include DIR/aux-var/std_conf_prefix
-
-
-# ----- Main settings -----
-
-acl_smtp_rcpt = accept
-acl_smtp_data = accept
-
-event_action = ${acl {logger}}
-
-
-# ----- ACL -----
-
-begin acl
-
 ev_tcp:
     accept condition = ${if eq {$event_name}{tcp:connect}}
        logwrite = . [$host_address]:$host_port
@@ -61,7 +44,7 @@ ev_msg:
     accept condition = ${if eq {$event_name}{msg:complete}}
        logwrite = . finished: $message_exim_id


-    accept condition = ${if !eq {$domain}{domain1}}
+    accept condition = ${if eq {$domain}{expansionfail}}
        logwrite = $this_expansion_will_fail


     accept condition = ${if eq {$event_name}{msg:delivery}}
@@ -89,35 +72,3 @@ logger:
        acl = ev_smtp
     accept condition = ${if eq {msg} {${listextract{1}{$event_name}}}}
        acl = ev_msg
-
-
-# ----- Routers -----
-
-begin routers
-
-dump_bounces:
-  driver = redirect
-  senders = :
-  data = :blackhole:
-
-others:
-  driver = manualroute
-  route_list = * 127.0.0.1 byname
-  self = send
-  transport = smtp
-  errors_to = ""
-  no_more
-
-
-# ----- Transports -----
-
-begin transports
-
-smtp:
-  driver = smtp
-  port = PORT_S
-  command_timeout = 1s
-  final_timeout = 1s
-  event_action =   ${acl {logger}}
-
-# End
diff --git a/test/confs/5700 b/test/confs/5700
index e1ce38e..774e766 100644
--- a/test/confs/5700
+++ b/test/confs/5700
@@ -15,80 +15,7 @@ event_action = ${acl {logger}}


begin acl

-ev_tcp:
-    accept condition = ${if eq {$event_name}{tcp:connect}}
-       logwrite = . [$host_address]:$host_port
-    accept condition = ${if eq {$event_name}{tcp:close}}
-       logwrite = . [$sending_ip_address] -> \
-            [$host_address]:$host_port
-    accept
-
-ev_smtp:
-    accept
-       logwrite = . [$sending_ip_address] -> \
-            [$host_address]:$host_port
-       logwrite = . banner <$event_data>
-
-ev_msg_fail:
-    accept condition = ${if eq {$event_name}{msg:fail:delivery}}
-       logwrite = . \
-        refused by fdqn <$host> \
-        local_part <$local_part> \
-        domain <$domain> \
-        errstr <$event_data> \
-
-    accept logwrite = . \
-        local_part <$local_part> \
-        domain <$domain> \
-        reason <$event_data>
-
-ev_msg_log:
-    accept logwrite = . \
-        $acl_arg1 \
-        ip <$host_address> \
-        port <$host_port> \
-        fqdn <$host> \
-        local_part <$local_part> \
-        domain <$domain> \
-        $acl_arg2 \
-        router <$router_name> \
-        transport <$transport_name>
-
-ev_msg:
-    accept condition = ${if eq {fail} {${listextract{2}{$event_name}}}}
-       acl = ev_msg_fail
-
-    accept condition = ${if eq {$event_name}{msg:complete}}
-       logwrite = . finished: $message_exim_id
-
-    accept condition = ${if !eq {$domain}{domain1}}
-       logwrite = $this_expansion_will_fail
-
-    accept condition = ${if eq {$event_name}{msg:delivery}}
-       acl = ev_msg_log delivery "confirmation <$event_data>"
-
-    accept condition = ${if eq {$event_name}{msg:host:defer}}
-       acl = ev_msg_log "host deferral" \
-            "errno <$event_defer_errno> errstr <$event_data>"
-
-    accept condition = ${if eq {$event_name}{msg:rcpt:defer}}
-       set acl_m_ev_lkup =    ${eval:$event_defer_errno & 0xff}
-       set acl_m_ev_lkup =    ${if = {$acl_m_ev_lkup}{65} {A} \
-                { ${if = {$acl_m_ev_lkup}{77} {MX} \
-                  {$acl_m_ev_lkup}}}}
-       set acl_m_ev_code =  4${eval:$event_defer_errno >>8}
-       acl = ev_msg_log "rcpt deferral" \
-            "err <$event_defer_errno>:<$acl_m_ev_lkup:$acl_m_ev_code> \
-            errstr <$event_data>"
-
-logger:
-    warn   logwrite = event $event_name
-    accept condition = ${if eq {tcp} {${listextract{1}{$event_name}}}}
-       acl = ev_tcp
-    accept condition = ${if eq {smtp} {${listextract{1}{$event_name}}}}
-       acl = ev_smtp
-    accept condition = ${if eq {msg} {${listextract{1}{$event_name}}}}
-       acl = ev_msg
+.include DIR/aux-fixed/event-logger-acl



# ----- Routers -----
diff --git a/test/confs/5701 b/test/confs/5701
new file mode 100644
index 0000000..ff050ff
--- /dev/null
+++ b/test/confs/5701
@@ -0,0 +1,40 @@
+# Exim test configuration 5701
+
+.include DIR/aux-var/std_conf_prefix
+
+# ----- Main settings -----
+
+event_action = ${acl {logger}}
+
+# ----- ACL -----
+
+begin acl
+
+.include DIR/aux-fixed/event-logger-acl
+
+# ----- Routers -----
+
+begin routers
+
+router_filter:
+ driver = redirect
+ reply_transport = reply
+ local_parts = userx-filter
+ allow_filter
+ data = #Exim filter\n seen mail text "This is an autoreply."
+ user = EXIMUSER
+
+others:
+ driver = redirect
+ data = :blackhole:
+
+# ----- Transports -----
+
+begin transports
+
+reply:
+ driver = autoreply
+ to = $reply_address
+ event_action = ${acl {logger}}
+
+# End
diff --git a/test/confs/5702 b/test/confs/5702
new file mode 100644
index 0000000..dfc063f
--- /dev/null
+++ b/test/confs/5702
@@ -0,0 +1,43 @@
+# Exim test configuration 5702
+
+.include DIR/aux-var/std_conf_prefix
+
+# ----- Main settings -----
+
+event_action = ${acl {logger}}
+
+# ----- ACL -----
+
+begin acl
+
+.include DIR/aux-fixed/event-logger-acl
+
+# ----- Routers -----
+
+begin routers
+
+route_userx:
+ driver = redirect
+ local_parts = userx
+ allow_filter
+ file = DIR/aux-fixed/TESTNUM.filter
+ user = EXIMUSER
+ no_more
+
+route_smtp:
+ driver = manualroute
+ route_list = * 127.0.0.1 byname
+ self = send
+ transport = smtp
+ no_more
+
+# ----- Transports -----
+
+begin transports
+
+smtp:
+ driver = smtp
+ port = PORT_S
+ event_action = ${acl {logger}}
+
+# End
diff --git a/test/confs/5703 b/test/confs/5703
new file mode 100644
index 0000000..267f5fc
--- /dev/null
+++ b/test/confs/5703
@@ -0,0 +1,43 @@
+# Exim test configuration 5703
+
+.include DIR/aux-var/std_conf_prefix
+
+# ----- Main settings -----
+
+event_action = ${acl {logger}}
+
+# ----- ACL -----
+
+begin acl
+
+.include DIR/aux-fixed/event-logger-acl
+
+# ----- Routers -----
+
+begin routers
+
+route_userx:
+ driver = redirect
+ local_parts = userx
+ allow_filter
+ file = DIR/aux-fixed/TESTNUM.filter
+ user = EXIMUSER
+ no_more
+
+route_smtp:
+ driver = manualroute
+ route_list = * 127.0.0.1 byname
+ self = send
+ transport = smtp
+ no_more
+
+# ----- Transports -----
+
+begin transports
+
+smtp:
+ driver = smtp
+ port = PORT_S
+ event_action = ${acl {logger}}
+
+# End
diff --git a/test/log/5700 b/test/log/5700
index eda35bc..6edadc9 100644
--- a/test/log/5700
+++ b/test/log/5700
@@ -23,7 +23,7 @@
1999-03-02 09:44:33 10HmaX-0005vi-00 . banner <220 ESMTP>
1999-03-02 09:44:33 10HmaX-0005vi-00 event tcp:close
1999-03-02 09:44:33 10HmaX-0005vi-00 . [127.0.0.1] -> [127.0.0.1]:1224
-1999-03-02 09:44:33 10HmaX-0005vi-00 => userx@domain2 R=others T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
+1999-03-02 09:44:33 10HmaX-0005vi-00 => userx@expansionfail R=others T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
1999-03-02 09:44:33 10HmaX-0005vi-00 event msg:delivery
1999-03-02 09:44:33 10HmaX-0005vi-00 failed to expand event_action msg:delivery in smtp: error from acl "logger"

@@ -44,6 +44,8 @@
 1999-03-02 09:44:33 10HmaZ-0005vi-00 . host deferral ip <127.0.0.1> port <1224> fqdn <127.0.0.1> local_part <userx> domain <domain1> errno <EEE> errstr <SMTP timeout after EHLO the.local.host.name: Connection timed out> router <others> transport <smtp>
 1999-03-02 09:44:33 10HmaZ-0005vi-00 == userx@domain1 R=others T=smtp defer (dd): Connection timed out H=127.0.0.1 [127.0.0.1]: SMTP timeout after EHLO the.local.host.name
 1999-03-02 09:44:33 10HmaZ-0005vi-00 ** userx@domain1: retry timeout exceeded
+1999-03-02 09:44:33 10HmaZ-0005vi-00 event msg:fail:delivery
+1999-03-02 09:44:33 10HmaZ-0005vi-00 . refused by fdqn <127.0.0.1> local_part <userx> domain <domain1> errstr <SMTP timeout after EHLO the.local.host.name: retry timeout exceeded>
 1999-03-02 09:44:33 10HmaZ-0005vi-00 userx@domain1: error ignored
 1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
 1999-03-02 09:44:33 10HmaZ-0005vi-00 event msg:complete
@@ -62,6 +64,8 @@
 1999-03-02 09:44:33 10HmbA-0005vi-00 . [127.0.0.1] -> [127.0.0.1]:1224
 1999-03-02 09:44:33 10HmbA-0005vi-00 == userx@domain1 R=others T=smtp defer (-44) H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:<userx@domain1>: 450 NOT RIGHT NOW
 1999-03-02 09:44:33 10HmbA-0005vi-00 ** userx@domain1: retry timeout exceeded
+1999-03-02 09:44:33 10HmbA-0005vi-00 event msg:fail:delivery
+1999-03-02 09:44:33 10HmbA-0005vi-00 . refused by fdqn <127.0.0.1> local_part <userx> domain <domain1> errstr <SMTP error from remote mail server after RCPT TO:<userx@domain1>: 450 NOT RIGHT NOW: retry timeout exceeded>
 1999-03-02 09:44:33 10HmbA-0005vi-00 userx@domain1: error ignored
 1999-03-02 09:44:33 10HmbA-0005vi-00 Completed
 1999-03-02 09:44:33 10HmbA-0005vi-00 event msg:complete
diff --git a/test/log/5701 b/test/log/5701
new file mode 100644
index 0000000..7dfde51
--- /dev/null
+++ b/test/log/5701
@@ -0,0 +1,20 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss
+1999-03-02 09:44:33 10HmaX-0005vi-00 ** >**bad-reply** <userx-filter@domain1> R=router_filter T=reply: filter autoreply generated syntactically invalid recipient
+1999-03-02 09:44:33 10HmaX-0005vi-00 event msg:fail:delivery
+1999-03-02 09:44:33 10HmaX-0005vi-00 . refused by fdqn <> local_part <>**bad-reply**> domain <> errstr <filter autoreply generated syntactically invalid recipient>
+1999-03-02 09:44:33 10HmaX-0005vi-00 >**bad-reply** <userx-filter@domain1>: error ignored
+1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaX-0005vi-00 event msg:complete
+1999-03-02 09:44:33 10HmaX-0005vi-00 . finished: 10HmaX-0005vi-00
+1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss
+1999-03-02 09:44:33 10HmaZ-0005vi-00 <= <> R=10HmaY-0005vi-00 U=EXIMUSER P=local S=sss
+1999-03-02 09:44:33 10HmaZ-0005vi-00 => :blackhole: <userx@domain1> R=others
+1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaZ-0005vi-00 event msg:complete
+1999-03-02 09:44:33 10HmaZ-0005vi-00 . finished: 10HmaZ-0005vi-00
+1999-03-02 09:44:33 10HmaY-0005vi-00 => >userx@domain1 <userx-filter@domain1> R=router_filter T=reply
+1999-03-02 09:44:33 10HmaY-0005vi-00 event msg:delivery
+1999-03-02 09:44:33 10HmaY-0005vi-00 . delivery ip <> port <0> fqdn <> local_part <>userx@domain1> domain <domain1> confirmation <> router <router_filter> transport <reply>
+1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaY-0005vi-00 event msg:complete
+1999-03-02 09:44:33 10HmaY-0005vi-00 . finished: 10HmaY-0005vi-00
diff --git a/test/log/5702 b/test/log/5702
new file mode 100644
index 0000000..66e2b90
--- /dev/null
+++ b/test/log/5702
@@ -0,0 +1,20 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss
+1999-03-02 09:44:33 Start queue run: pid=pppp -qqf
+1999-03-02 09:44:33 10HmaX-0005vi-00 event tcp:connect
+1999-03-02 09:44:33 10HmaX-0005vi-00 . [127.0.0.1]:1111
+1999-03-02 09:44:33 10HmaX-0005vi-00 event smtp:connect
+1999-03-02 09:44:33 10HmaX-0005vi-00 . [127.0.0.1] -> [127.0.0.1]:1224
+1999-03-02 09:44:33 10HmaX-0005vi-00 . banner <220 ESMTP>
+1999-03-02 09:44:33 10HmaX-0005vi-00 event tcp:close
+1999-03-02 09:44:33 10HmaX-0005vi-00 . [127.0.0.1] -> [127.0.0.1]:1224
+1999-03-02 09:44:33 10HmaX-0005vi-00 => userx@domain1 R=route_smtp T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
+1999-03-02 09:44:33 10HmaX-0005vi-00 event msg:delivery
+1999-03-02 09:44:33 10HmaX-0005vi-00 . delivery ip <127.0.0.1> port <1224> fqdn <127.0.0.1> local_part <userx> domain <domain1> confirmation <250 OK> router <route_smtp> transport <smtp>
+1999-03-02 09:44:33 10HmaX-0005vi-00 ** usery@domain1 <userx@domain1> R=route_smtp T=smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:<usery@domain1>: 550 Not that one
+1999-03-02 09:44:33 10HmaX-0005vi-00 event msg:fail:delivery
+1999-03-02 09:44:33 10HmaX-0005vi-00 . refused by fdqn <127.0.0.1> local_part <usery> domain <domain1> errstr <SMTP error from remote mail server after RCPT TO:<usery@domain1>: 550 Not that one>
+1999-03-02 09:44:33 10HmaX-0005vi-00 usery@domain1 <userx@domain1>: error ignored
+1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaX-0005vi-00 event msg:complete
+1999-03-02 09:44:33 10HmaX-0005vi-00 . finished: 10HmaX-0005vi-00
+1999-03-02 09:44:33 End queue run: pid=pppp -qqf
diff --git a/test/log/5703 b/test/log/5703
new file mode 100644
index 0000000..ab707c0
--- /dev/null
+++ b/test/log/5703
@@ -0,0 +1,32 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@??? U=CALLER P=local S=sss
+1999-03-02 09:44:33 Start queue run: pid=pppp -qqf
+1999-03-02 09:44:33 10HmaX-0005vi-00 event tcp:connect
+1999-03-02 09:44:33 10HmaX-0005vi-00 . [127.0.0.1]:1111
+1999-03-02 09:44:33 10HmaX-0005vi-00 event smtp:connect
+1999-03-02 09:44:33 10HmaX-0005vi-00 . [127.0.0.1] -> [127.0.0.1]:1224
+1999-03-02 09:44:33 10HmaX-0005vi-00 . banner <220 ESMTP>
+1999-03-02 09:44:33 10HmaX-0005vi-00 event tcp:close
+1999-03-02 09:44:33 10HmaX-0005vi-00 . [127.0.0.1] -> [127.0.0.1]:1224
+1999-03-02 09:44:33 10HmaX-0005vi-00 event msg:fail:delivery
+1999-03-02 09:44:33 10HmaX-0005vi-00 . refused by fdqn <127.0.0.1> local_part <usery> domain <domain1> errstr <SMTP error from remote mail server after RCPT TO:<usery@domain1>: 550 Not that one>
+1999-03-02 09:44:33 10HmaX-0005vi-00 ** usery@domain1 <userx@domain1> R=route_smtp T=smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:<usery@domain1>: 550 Not that one
+1999-03-02 09:44:33 10HmaY-0005vi-00 <= <> R=10HmaX-0005vi-00 U=EXIMUSER P=local S=sss
+1999-03-02 09:44:33 10HmaY-0005vi-00 event tcp:connect
+1999-03-02 09:44:33 10HmaY-0005vi-00 . [127.0.0.1]:1111
+1999-03-02 09:44:33 10HmaY-0005vi-00 event tcp:close
+1999-03-02 09:44:33 10HmaY-0005vi-00 . [127.0.0.1] -> [127.0.0.1]:1224
+1999-03-02 09:44:33 10HmaY-0005vi-00 H=127.0.0.1 [127.0.0.1]: Remote host closed connection in response to initial connection
+1999-03-02 09:44:33 10HmaY-0005vi-00 event msg:host:defer
+1999-03-02 09:44:33 10HmaY-0005vi-00 . host deferral ip <127.0.0.1> port <1224> fqdn <127.0.0.1> local_part <CALLER> domain <the.local.host.name> errno <-18> errstr <Remote host closed connection in response to initial connection> router <route_smtp> transport <smtp>
+1999-03-02 09:44:33 10HmaY-0005vi-00 == CALLER@??? R=route_smtp T=smtp defer (-18) H=127.0.0.1 [127.0.0.1]: Remote host closed connection in response to initial connection
+1999-03-02 09:44:33 10HmaY-0005vi-00 ** CALLER@???: retry timeout exceeded
+1999-03-02 09:44:33 10HmaY-0005vi-00 event msg:fail:delivery
+1999-03-02 09:44:33 10HmaY-0005vi-00 . refused by fdqn <127.0.0.1> local_part <CALLER> domain <the.local.host.name> errstr <Remote host closed connection in response to initial connection: retry timeout exceeded>
+1999-03-02 09:44:33 10HmaY-0005vi-00 CALLER@???: error ignored
+1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaY-0005vi-00 event msg:complete
+1999-03-02 09:44:33 10HmaY-0005vi-00 . finished: 10HmaY-0005vi-00
+1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaX-0005vi-00 event msg:complete
+1999-03-02 09:44:33 10HmaX-0005vi-00 . finished: 10HmaX-0005vi-00
+1999-03-02 09:44:33 End queue run: pid=pppp -qqf
diff --git a/test/scripts/5700-events/5700 b/test/scripts/5700-events/5700
index 42735db..89b0c5c 100644
--- a/test/scripts/5700-events/5700
+++ b/test/scripts/5700-events/5700
@@ -29,7 +29,7 @@ exim -qqf
 #
 #
 #
-exim -odq userx@domain2
+exim -odq userx@expansionfail
 A deliverable message which will hit a coding error in the config
 ****
 server PORT_S
diff --git a/test/scripts/5700-events/5701 b/test/scripts/5700-events/5701
new file mode 100644
index 0000000..50e1c27
--- /dev/null
+++ b/test/scripts/5700-events/5701
@@ -0,0 +1,19 @@
+# Events for syntactically invalid generated recipient on autoreply
+#
+exim -odi userx-filter@domain1
+Subject: Bad from
+From: "something" x@y
+
+This is a test with a syntactically bad From: line and we process it
+with a filter and fire events.
+****
+#
+#
+#
+#
+exim -odi userx-filter@domain1
+Subject: Good from
+From: "User X" <userx@domain1>
+
+This is a test we process with a filter and fire events.
+****
diff --git a/test/scripts/5700-events/5702 b/test/scripts/5700-events/5702
new file mode 100644
index 0000000..b970ec0
--- /dev/null
+++ b/test/scripts/5700-events/5702
@@ -0,0 +1,26 @@
+# Raise msg:fail:delivery when an error, originated by a filter, gets ignored.
+#
+exim -odq userx@domain1
+Also try to deliver this message to usery via a filter deliver command.
+However that fails. But because of the noerror cmd the error just gets ignored.
+****
+server PORT_S
+220 ESMTP
+EHLO
+250-OK
+250 HELP
+MAIL
+250 OK
+RCPT
+250 OK
+RCPT
+550 Not that one
+DATA
+354 More...
+.
+250 OK
+QUIT
+220 OK
+****
+exim -qqf
+****
diff --git a/test/scripts/5700-events/5703 b/test/scripts/5700-events/5703
new file mode 100644
index 0000000..54fd485
--- /dev/null
+++ b/test/scripts/5700-events/5703
@@ -0,0 +1,20 @@
+# Raise msg:fail:delivery when an error of a failed bounce gets ignored.
+#
+exim -odq userx@domain1
+Try to deliver this message to usery via a filter deliver "redirect".
+However that fails. Later the bounce also fails.
+****
+server PORT_S 2
+220 ESMTP
+EHLO
+250-OK
+250 HELP
+MAIL
+250 OK
+RCPT
+550 Not that one
+QUIT
+220 OK
+****
+exim -qqf
+****
diff --git a/test/stdout/5700 b/test/stdout/5700
index 066f6ce..98ba767 100644
--- a/test/stdout/5700
+++ b/test/stdout/5700
@@ -37,14 +37,14 @@ EHLO the.local.host.name
 250 HELP
 MAIL FROM:<>
 250 OK
-RCPT TO:<userx@domain2>
+RCPT TO:<userx@expansionfail>
 250 OK
 DATA
 354 More...
 Received: from CALLER by the.local.host.name with local (Exim x.yz)
     (envelope-from <CALLER@???>)
     id 10HmaX-0005vi-00
-    for userx@domain2; Tue, 2 Mar 1999 09:44:33 +0000
+    for userx@expansionfail; Tue, 2 Mar 1999 09:44:33 +0000
 Message-Id: <E10HmaX-0005vi-00@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
diff --git a/test/stdout/5702 b/test/stdout/5702
new file mode 100644
index 0000000..de07377
--- /dev/null
+++ b/test/stdout/5702
@@ -0,0 +1,31 @@
+
+******** SERVER ********
+Listening on port 1224 ... 
+Connection request from [127.0.0.1]
+220 ESMTP
+EHLO the.local.host.name
+250-OK
+250 HELP
+MAIL FROM:<CALLER@???>
+250 OK
+RCPT TO:<userx@domain1>
+250 OK
+RCPT TO:<usery@domain1>
+550 Not that one
+DATA
+354 More...
+Received: from CALLER by the.local.host.name with local (Exim x.yz)
+    (envelope-from <CALLER@???>)
+    id 10HmaX-0005vi-00
+    for userx@domain1; Tue, 2 Mar 1999 09:44:33 +0000
+Message-Id: <E10HmaX-0005vi-00@???>
+From: CALLER_NAME <CALLER@???>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+Also try to deliver this message to usery via a filter deliver command.
+However that fails. But because of the noerror cmd the error just gets ignored.
+.
+250 OK
+QUIT
+220 OK
+End of script
diff --git a/test/stdout/5703 b/test/stdout/5703
new file mode 100644
index 0000000..c171ca3
--- /dev/null
+++ b/test/stdout/5703
@@ -0,0 +1,17 @@
+
+******** SERVER ********
+Listening on port 1224 ... 
+Connection request from [127.0.0.1]
+220 ESMTP
+EHLO the.local.host.name
+250-OK
+250 HELP
+MAIL FROM:<CALLER@???>
+250 OK
+RCPT TO:<usery@domain1>
+550 Not that one
+QUIT
+220 OK
+Listening on port 1224 ... 
+Connection request from [127.0.0.1]
+End of script