Gitweb:
https://git.exim.org/exim.git/commitdiff/1fa1333ca1a744ce7fa8af3fc73872b082631fe3
Commit: 1fa1333ca1a744ce7fa8af3fc73872b082631fe3
Parent: f0be4dfa19120173aa76001d31b2cd90284ecd07
Author: Jeremy Harris <jgh146exb@???>
AuthorDate: Sat Jan 19 22:28:54 2019 +0000
Committer: Jeremy Harris <jgh146exb@???>
CommitDate: Sat Jan 19 22:28:54 2019 +0000
Events: log a non-success when a client connect is denied by an event
---
src/src/deliver.c | 1 +
src/src/log.c | 1 +
src/src/macros.h | 1 +
test/confs/5707 | 56 +++++++++++++++++++++++++++++++++++++++++++
test/log/5707 | 4 ++++
test/scripts/5700-events/5707 | 6 +++++
6 files changed, 69 insertions(+)
diff --git a/src/src/deliver.c b/src/src/deliver.c
index 1baf7d3..307989d 100644
--- a/src/src/deliver.c
+++ b/src/src/deliver.c
@@ -856,6 +856,7 @@ if (action)
{
DEBUG(D_deliver)
debug_printf("Event(%s): event_action returned \"%s\"\n", event, s);
+ errno = ERRNO_EVENT;
return s;
}
}
diff --git a/src/src/log.c b/src/src/log.c
index 4905b6d..0aaf94a 100644
--- a/src/src/log.c
+++ b/src/src/log.c
@@ -112,6 +112,7 @@ static const uschar * exim_errstrings[] = {
US"Local-only delivery",
US"Domain in queue_domains",
US"Transport concurrency limit",
+ US"Event requests alternate response",
};
diff --git a/src/src/macros.h b/src/src/macros.h
index e797615..185ea6a 100644
--- a/src/src/macros.h
+++ b/src/src/macros.h
@@ -570,6 +570,7 @@ table exim_errstrings[] in log.c */
#define ERRNO_LOCAL_ONLY (-54) /* Local-only delivery */
#define ERRNO_QUEUE_DOMAIN (-55) /* Domain in queue_domains */
#define ERRNO_TRETRY (-56) /* Transport concurrency limit */
+#define ERRNO_EVENT (-57) /* Event processing request alternate response */
diff --git a/test/confs/5707 b/test/confs/5707
new file mode 100644
index 0000000..35d5eff
--- /dev/null
+++ b/test/confs/5707
@@ -0,0 +1,56 @@
+# Exim test configuration 5707
+
+.include DIR/aux-var/std_conf_prefix
+
+
+# ----- Main settings -----
+
+acl_smtp_rcpt = accept
+acl_smtp_data = accept
+
+event_action = ${acl {logger}}
+
+
+# ----- ACL -----
+
+begin acl
+
+.include DIR/aux-fixed/event-logger-acl
+
+conn_deny:
+ accept !condition = ${if eq {tcp:connect}{$event_name}}
+ deny logwrite = Denying tcp connection
+ message = deny
+
+# ----- 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
+ event_action = ${acl {conn_deny}}
+
+# ----- Retry -----
+begin retry
+* * F,5d,10s
+
+# End
diff --git a/test/log/5707 b/test/log/5707
new file mode 100644
index 0000000..643dad2
--- /dev/null
+++ b/test/log/5707
@@ -0,0 +1,4 @@
+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 Denying tcp connection
+1999-03-02 09:44:33 10HmaX-0005vi-00 H=127.0.0.1 [127.0.0.1] Event requests alternate response
+1999-03-02 09:44:33 10HmaX-0005vi-00 == userx@domain1 R=others T=smtp defer (-57)
diff --git a/test/scripts/5700-events/5707 b/test/scripts/5700-events/5707
new file mode 100644
index 0000000..a8b5ffe
--- /dev/null
+++ b/test/scripts/5700-events/5707
@@ -0,0 +1,6 @@
+# tcp:connect deny
+#
+exim -odf userx@domain1
+A deliverable message
+****
+no_msglog_check