summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2007-06-20 14:13:39 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2007-06-20 14:13:39 +0000
commit8f2401034e2ce4007b1f270cd389381753c814eb (patch)
treed1d88b61972f84d9cfceff56c752bd6f94608917 /test
parenta96603a0e5a7283a9275fb090dac95a42e05a423 (diff)
Add /noupdate as a ratelimit option.
Diffstat (limited to 'test')
-rw-r--r--test/confs/003818
-rw-r--r--test/scripts/0000-Basic/003810
-rw-r--r--test/stderr/003889
-rw-r--r--test/stdout/003816
4 files changed, 120 insertions, 13 deletions
diff --git a/test/confs/0038 b/test/confs/0038
index 497623a6d..e40799455 100644
--- a/test/confs/0038
+++ b/test/confs/0038
@@ -2,6 +2,7 @@
RRATELIMIT=0/1h/strict
DRATELIMIT=0/1h/per_byte/strict
+ACLRCPT=check_rcpt
exim_path = EXIM_PATH
host_lookup_order = bydns
@@ -14,7 +15,7 @@ gecos_name = CALLER_NAME
# ----- Main settings -----
-acl_smtp_rcpt = check_rcpt
+acl_smtp_rcpt = ACLRCPT
acl_smtp_data = check_data
qualify_domain = test.ex
@@ -31,6 +32,21 @@ check_rcpt:
sender_rate_period=$sender_rate_period
accept
+check_rcpt2:
+ warn ratelimit = RRATELIMIT/noupdate
+ log_message = RCPT2-1: \
+ sender_rate=$sender_rate \
+ sender_rate_limit=$sender_rate_limit \
+ sender_rate_period=$sender_rate_period
+
+ warn ratelimit = RRATELIMIT
+ log_message = RCPT2-2: \
+ sender_rate=$sender_rate \
+ sender_rate_limit=$sender_rate_limit \
+ sender_rate_period=$sender_rate_period
+
+ accept
+
check_data:
warn ratelimit = DRATELIMIT
log_message = DATA: \
diff --git a/test/scripts/0000-Basic/0038 b/test/scripts/0000-Basic/0038
index 6ba85d3cf..4d87755a2 100644
--- a/test/scripts/0000-Basic/0038
+++ b/test/scripts/0000-Basic/0038
@@ -46,3 +46,13 @@ Here is some data.
.
quit
****
+exim -bh V4NET.9.8.6 -DRRATELIMIT=1/1m/per_rcpt -DACLRCPT=check_rcpt2
+ehlo test.ex
+mail from:<>
+rcpt to:<a@b>
+rcpt to:<b@c>
+data
+Here is some data.
+.
+quit
+****
diff --git a/test/stderr/0038 b/test/stderr/0038
index c3c0346f4..5176c99a3 100644
--- a/test/stderr/0038
+++ b/test/stderr/0038
@@ -11,8 +11,9 @@
>>> using ACL "check_rcpt"
>>> processing "warn"
>>> check ratelimit = 0/1h/strict
->>> ratelimit condition limit=0 period=3600 key=1h/strict / V4NET.9.8.7
+>>> ratelimit condition limit=0 period=3600 key=1h/per_mail/strict/V4NET.9.8.7
>>> ratelimit initializing new key's data
+>>> ratelimit db updated
>>> ratelimit computed rate 0.0
>>> warn: condition test succeeded
LOG: H=(test.ex) [V4NET.9.8.7] Warning: RCPT: sender_rate=0.0 sender_rate_limit=0 sender_rate_period=1h
@@ -22,8 +23,9 @@ LOG: H=(test.ex) [V4NET.9.8.7] Warning: RCPT: sender_rate=0.0 sender_rate_limit=
>>> using ACL "check_data"
>>> processing "warn"
>>> check ratelimit = 0/1h/per_byte/strict
->>> ratelimit condition limit=0 period=3600 key=1h/per_byte/strict / V4NET.9.8.7
+>>> ratelimit condition limit=0 period=3600 key=1h/per_byte/strict/V4NET.9.8.7
>>> ratelimit initializing new key's data
+>>> ratelimit db updated
>>> ratelimit computed rate 0.0
>>> warn: condition test succeeded
LOG: 10HmaX-0005vi-00 H=(test.ex) [V4NET.9.8.7] Warning: DATA: sender_rate=0.0 sender_rate_limit=0 sender_rate_period=1h
@@ -43,7 +45,8 @@ LOG: 10HmaX-0005vi-00 H=(test.ex) [V4NET.9.8.7] F=<> rejected after DATA
>>> using ACL "check_rcpt"
>>> processing "warn"
>>> check ratelimit = 0/1h/strict
->>> ratelimit condition limit=0 period=3600 key=1h/strict / V4NET.9.8.7
+>>> ratelimit condition limit=0 period=3600 key=1h/per_mail/strict/V4NET.9.8.7
+>>> ratelimit db updated
>>> ratelimit computed rate 1.0
>>> warn: condition test succeeded
LOG: H=(test.ex) [V4NET.9.8.7] Warning: RCPT: sender_rate=1.0 sender_rate_limit=0 sender_rate_period=1h
@@ -53,7 +56,8 @@ LOG: H=(test.ex) [V4NET.9.8.7] Warning: RCPT: sender_rate=1.0 sender_rate_limit=
>>> using ACL "check_data"
>>> processing "warn"
>>> check ratelimit = 0/1h/per_byte/strict
->>> ratelimit condition limit=0 period=3600 key=1h/per_byte/strict / V4NET.9.8.7
+>>> ratelimit condition limit=0 period=3600 key=1h/per_byte/strict/V4NET.9.8.7
+>>> ratelimit db updated
>>> ratelimit computed rate 19.0
>>> warn: condition test succeeded
LOG: 10HmaY-0005vi-00 H=(test.ex) [V4NET.9.8.7] Warning: DATA: sender_rate=19.0 sender_rate_limit=0 sender_rate_period=1h
@@ -73,8 +77,9 @@ LOG: 10HmaY-0005vi-00 H=(test.ex) [V4NET.9.8.7] F=<> rejected after DATA
>>> using ACL "check_rcpt"
>>> processing "warn"
>>> check ratelimit = 0/1h/per_conn/strict
->>> ratelimit condition limit=0 period=3600 key=1h/per_conn/strict / V4NET.9.8.7
+>>> ratelimit condition limit=0 period=3600 key=1h/per_conn/strict/V4NET.9.8.7
>>> ratelimit initializing new key's data
+>>> ratelimit db updated
>>> ratelimit computed rate 0.0
>>> warn: condition test succeeded
LOG: H=(test.ex) [V4NET.9.8.7] Warning: RCPT: sender_rate=0.0 sender_rate_limit=0 sender_rate_period=1h
@@ -84,7 +89,7 @@ LOG: H=(test.ex) [V4NET.9.8.7] Warning: RCPT: sender_rate=0.0 sender_rate_limit=
>>> using ACL "check_data"
>>> processing "warn"
>>> check ratelimit = 0/1h/per_conn/strict
->>> ratelimit condition limit=0 period=3600 key=1h/per_conn/strict / V4NET.9.8.7
+>>> ratelimit condition limit=0 period=3600 key=1h/per_conn/strict/V4NET.9.8.7
>>> ratelimit found pre-computed rate 0.0
>>> warn: condition test succeeded
LOG: 10HmaZ-0005vi-00 H=(test.ex) [V4NET.9.8.7] Warning: DATA: sender_rate=0.0 sender_rate_limit=0 sender_rate_period=1h
@@ -104,7 +109,8 @@ LOG: 10HmaZ-0005vi-00 H=(test.ex) [V4NET.9.8.7] F=<> rejected after DATA
>>> using ACL "check_rcpt"
>>> processing "warn"
>>> check ratelimit = 0/1h/per_conn/strict
->>> ratelimit condition limit=0 period=3600 key=1h/per_conn/strict / V4NET.9.8.7
+>>> ratelimit condition limit=0 period=3600 key=1h/per_conn/strict/V4NET.9.8.7
+>>> ratelimit db updated
>>> ratelimit computed rate 1.0
>>> warn: condition test succeeded
LOG: H=(test.ex) [V4NET.9.8.7] Warning: RCPT: sender_rate=1.0 sender_rate_limit=0 sender_rate_period=1h
@@ -114,7 +120,7 @@ LOG: H=(test.ex) [V4NET.9.8.7] Warning: RCPT: sender_rate=1.0 sender_rate_limit=
>>> using ACL "check_data"
>>> processing "warn"
>>> check ratelimit = 0/1h/per_conn/strict
->>> ratelimit condition limit=0 period=3600 key=1h/per_conn/strict / V4NET.9.8.7
+>>> ratelimit condition limit=0 period=3600 key=1h/per_conn/strict/V4NET.9.8.7
>>> ratelimit found pre-computed rate 1.0
>>> warn: condition test succeeded
LOG: 10HmbA-0005vi-00 H=(test.ex) [V4NET.9.8.7] Warning: DATA: sender_rate=1.0 sender_rate_limit=0 sender_rate_period=1h
@@ -134,8 +140,9 @@ LOG: 10HmbA-0005vi-00 H=(test.ex) [V4NET.9.8.7] F=<> rejected after DATA
>>> using ACL "check_rcpt"
>>> processing "warn"
>>> check ratelimit = 0/1h/per_rcpt
->>> ratelimit condition limit=0 period=3600 key=1h/per_rcpt / V4NET.9.8.7
+>>> ratelimit condition limit=0 period=3600 key=1h/per_cmd/leaky/V4NET.9.8.7
>>> ratelimit initializing new key's data
+>>> ratelimit db not updated: over the limit, but leaky
>>> ratelimit computed rate 0.0
>>> warn: condition test succeeded
LOG: H=(test.ex) [V4NET.9.8.7] Warning: RCPT: sender_rate=0.0 sender_rate_limit=0 sender_rate_period=1h
@@ -144,8 +151,9 @@ LOG: H=(test.ex) [V4NET.9.8.7] Warning: RCPT: sender_rate=0.0 sender_rate_limit=
>>> using ACL "check_rcpt"
>>> processing "warn"
>>> check ratelimit = 0/1h/per_rcpt
->>> ratelimit condition limit=0 period=3600 key=1h/per_rcpt / V4NET.9.8.7
+>>> ratelimit condition limit=0 period=3600 key=1h/per_cmd/leaky/V4NET.9.8.7
>>> ratelimit initializing new key's data
+>>> ratelimit db not updated: over the limit, but leaky
>>> ratelimit computed rate 0.0
>>> warn: condition test succeeded
>>> processing "accept"
@@ -153,8 +161,9 @@ LOG: H=(test.ex) [V4NET.9.8.7] Warning: RCPT: sender_rate=0.0 sender_rate_limit=
>>> using ACL "check_rcpt"
>>> processing "warn"
>>> check ratelimit = 0/1h/per_rcpt
->>> ratelimit condition limit=0 period=3600 key=1h/per_rcpt / V4NET.9.8.7
+>>> ratelimit condition limit=0 period=3600 key=1h/per_cmd/leaky/V4NET.9.8.7
>>> ratelimit initializing new key's data
+>>> ratelimit db not updated: over the limit, but leaky
>>> ratelimit computed rate 0.0
>>> warn: condition test succeeded
>>> processing "accept"
@@ -163,11 +172,67 @@ LOG: H=(test.ex) [V4NET.9.8.7] Warning: RCPT: sender_rate=0.0 sender_rate_limit=
>>> using ACL "check_data"
>>> processing "warn"
>>> check ratelimit = 0/1h/per_conn
->>> ratelimit condition limit=0 period=3600 key=1h/per_conn / V4NET.9.8.7
+>>> ratelimit condition limit=0 period=3600 key=1h/per_conn/leaky/V4NET.9.8.7
>>> ratelimit initializing new key's data
+>>> ratelimit db not updated: over the limit, but leaky
>>> ratelimit computed rate 0.0
>>> warn: condition test succeeded
LOG: 10HmbB-0005vi-00 H=(test.ex) [V4NET.9.8.7] Warning: DATA: sender_rate=0.0 sender_rate_limit=0 sender_rate_period=1h
>>> processing "deny"
>>> deny: condition test succeeded
LOG: 10HmbB-0005vi-00 H=(test.ex) [V4NET.9.8.7] F=<> rejected after DATA
+>>> host in hosts_connection_nolog? no (option unset)
+>>> host in host_lookup? no (option unset)
+>>> host in host_reject_connection? no (option unset)
+>>> host in sender_unqualified_hosts? no (option unset)
+>>> host in recipient_unqualified_hosts? no (option unset)
+>>> host in helo_verify_hosts? no (option unset)
+>>> host in helo_try_verify_hosts? no (option unset)
+>>> host in helo_accept_junk_hosts? no (option unset)
+>>> test.ex in helo_lookup_domains? no (end of list)
+>>> host in pipelining_advertise_hosts? yes (matched "*")
+>>> using ACL "check_rcpt2"
+>>> processing "warn"
+>>> check ratelimit = 1/1m/per_rcpt/noupdate
+>>> ratelimit condition limit=1 period=60 key=1m/per_cmd/leaky/V4NET.9.8.6
+>>> ratelimit initializing new key's data
+>>> ratelimit db not updated: noupdate set
+>>> ratelimit computed rate 0.0
+>>> warn: condition test failed
+>>> processing "warn"
+>>> check ratelimit = 1/1m/per_rcpt
+>>> ratelimit condition limit=1 period=60 key=1m/per_cmd/leaky/V4NET.9.8.6
+>>> ratelimit initializing new key's data
+>>> ratelimit db updated
+>>> ratelimit computed rate 0.0
+>>> warn: condition test failed
+>>> processing "accept"
+>>> accept: condition test succeeded
+>>> using ACL "check_rcpt2"
+>>> processing "warn"
+>>> check ratelimit = 1/1m/per_rcpt/noupdate
+>>> ratelimit condition limit=1 period=60 key=1m/per_cmd/leaky/V4NET.9.8.6
+>>> ratelimit db not updated: noupdate set
+>>> ratelimit computed rate 1.0
+>>> warn: condition test failed
+>>> processing "warn"
+>>> check ratelimit = 1/1m/per_rcpt
+>>> ratelimit condition limit=1 period=60 key=1m/per_cmd/leaky/V4NET.9.8.6
+>>> ratelimit db updated
+>>> ratelimit computed rate 1.0
+>>> warn: condition test failed
+>>> processing "accept"
+>>> accept: condition test succeeded
+>>> host in ignore_fromline_hosts? no (option unset)
+>>> using ACL "check_data"
+>>> processing "warn"
+>>> check ratelimit = 0/1h/per_byte/strict
+>>> ratelimit condition limit=0 period=3600 key=1h/per_byte/strict/V4NET.9.8.6
+>>> ratelimit initializing new key's data
+>>> ratelimit db updated
+>>> ratelimit computed rate 0.0
+>>> warn: condition test succeeded
+LOG: 10HmbC-0005vi-00 H=(test.ex) [V4NET.9.8.6] Warning: DATA: sender_rate=0.0 sender_rate_limit=0 sender_rate_period=1h
+>>> processing "deny"
+>>> deny: condition test succeeded
+LOG: 10HmbC-0005vi-00 H=(test.ex) [V4NET.9.8.6] F=<> rejected after DATA
diff --git a/test/stdout/0038 b/test/stdout/0038
index 4ff984306..9b927b47e 100644
--- a/test/stdout/0038
+++ b/test/stdout/0038
@@ -75,3 +75,19 @@
354 Enter message, ending with "." on a line by itself
550 Administrative prohibition
221 myhost.test.ex closing connection
+
+**** SMTP testing session as if from host V4NET.9.8.6
+**** but without any ident (RFC 1413) callback.
+**** This is not for real!
+
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250-myhost.test.ex Hello test.ex [V4NET.9.8.6]
+250-SIZE 52428800
+250-PIPELINING
+250 HELP
+250 OK
+250 Accepted
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+550 Administrative prohibition
+221 myhost.test.ex closing connection