diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2015-09-08 23:05:20 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2015-09-08 23:05:20 +0100 |
commit | f38917cc94ab337c15ff70c254dd564ee2dcafe7 (patch) | |
tree | 616248bb073b2883f74896ad0ef2bc07a063a770 /test | |
parent | 5980e62829e10336b008f861c938bfca799d488a (diff) |
Capture substrings in ACL regex= . Bug 425.
Diffstat (limited to 'test')
-rw-r--r-- | test/confs/0568 | 58 | ||||
-rw-r--r-- | test/log/0568 | 6 | ||||
-rw-r--r-- | test/mail/0568.userx | 33 | ||||
-rw-r--r-- | test/scripts/0000-Basic/0568 | 38 | ||||
-rw-r--r-- | test/stdout/0568 | 24 |
5 files changed, 159 insertions, 0 deletions
diff --git a/test/confs/0568 b/test/confs/0568 new file mode 100644 index 000000000..d5a8049c1 --- /dev/null +++ b/test/confs/0568 @@ -0,0 +1,58 @@ +# Exim test configuration 0568: ACL regex= + +exim_path = EXIM_PATH +host_lookup_order = bydns +primary_hostname = myhost.test.ex +rfc1413_query_timeout = 0s +spool_directory = DIR/spool +log_file_path = DIR/spool/log/%slog +gecos_pattern = "" +gecos_name = CALLER_NAME + + +# ----- Main settings ----- + +acl_smtp_rcpt = check_rcpt +acl_smtp_data = check_data +acl_not_smtp = check_data +acl_smtp_mime = check_mime + + +# ----- ACL ----- + +begin acl + +check_rcpt: + accept + +check_data: + warn regex = \N(THIS\s((\w+)\s)?REGEX)\N + message = X-Regex: Regex matched <$regex1> <$regex3> + + warn condition = ${if !eq{$h_fakereject:}{}} + control = fakereject + + warn condition = ${if !eq{$h_fakedefer:}{}} + control = fakedefer + + accept + +# ----- Routers ----- + +begin routers + +r1: + driver = accept + transport = t1 + +# ----- Transports ----- + +begin transports + +t1: + driver = appendfile + file = DIR/test-mail/$local_part + user = CALLER + + +# End diff --git a/test/log/0568 b/test/log/0568 new file mode 100644 index 000000000..1ab5847e6 --- /dev/null +++ b/test/log/0568 @@ -0,0 +1,6 @@ +1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss id=41C2F849.3060203@projectile.test.ex +1999-03-02 09:44:33 10HmaX-0005vi-00 => userx <userx@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 10HmaX-0005vi-00 Completed +1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss id=41C2F849.3060203@projectile.test.ex +1999-03-02 09:44:33 10HmaY-0005vi-00 => userx <userx@test.ex> R=r1 T=t1 +1999-03-02 09:44:33 10HmaY-0005vi-00 Completed diff --git a/test/mail/0568.userx b/test/mail/0568.userx new file mode 100644 index 000000000..59fa44af8 --- /dev/null +++ b/test/mail/0568.userx @@ -0,0 +1,33 @@ +From CALLER@myhost.test.ex Tue Mar 02 09:44:33 1999 +Received: from CALLER (helo=test.ex) + by myhost.test.ex with local-esmtp (Exim x.yz) + (envelope-from <CALLER@myhost.test.ex>) + id 10HmaX-0005vi-00 + for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +From: Test person <tp@cam.ac.uk> +To: Me <userx@test.ex> +Subject: A real test message +Date: Tue, 2 Mar 1999 09:44:33 +0000 +Message-ID: <41C2F849.3060203@projectile.test.ex> +Sender: CALLER_NAME <CALLER@myhost.test.ex> + +OK, this should look like a genuine message. + +From CALLER@myhost.test.ex Tue Mar 02 09:44:33 1999 +Received: from CALLER (helo=test.ex) + by myhost.test.ex with local-esmtp (Exim x.yz) + (envelope-from <CALLER@myhost.test.ex>) + id 10HmaY-0005vi-00 + for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +From: Test person <tp@cam.ac.uk> +To: Me <userx@test.ex> +Subject: A real test message +Date: Tue, 2 Mar 1999 09:44:33 +0000 +Message-ID: <41C2F849.3060203@projectile.test.ex> +FakeReject: test fakereject +Sender: CALLER_NAME <CALLER@myhost.test.ex> +X-Regex: Regex matched <THIS gazornenplaz REGEX> <gazornenplaz> + +OK, this should look like a genuine message, but +it will trip on THIS gazornenplaz REGEX. + diff --git a/test/scripts/0000-Basic/0568 b/test/scripts/0000-Basic/0568 new file mode 100644 index 000000000..a660f6805 --- /dev/null +++ b/test/scripts/0000-Basic/0568 @@ -0,0 +1,38 @@ +# ACL regex= test +# +# These tests are copies from testcase 4000; +# they should be removed from there but I don't +# run spamassassin so can't verify the change. +# +exim -odi -bs +ehlo test.ex +mail from:<> +rcpt to:<userx@test.ex> +data +From: Test person <tp@cam.ac.uk> +To: Me <userx@test.ex> +Subject: A real test message +Date: Fri, 17 Dec 2004 16:13:04 +0100 +Message-ID: <41C2F849.3060203@projectile.test.ex> + +OK, this should look like a genuine message. +. +quit +**** +exim -odi -bs +ehlo test.ex +mail from:<> +rcpt to:<userx@test.ex> +data +From: Test person <tp@cam.ac.uk> +To: Me <userx@test.ex> +Subject: A real test message +Date: Fri, 17 Dec 2004 16:13:04 +0100 +Message-ID: <41C2F849.3060203@projectile.test.ex> +FakeReject: test fakereject + +OK, this should look like a genuine message, but +it will trip on THIS gazornenplaz REGEX. +. +quit +**** diff --git a/test/stdout/0568 b/test/stdout/0568 new file mode 100644 index 000000000..2db3157dd --- /dev/null +++ b/test/stdout/0568 @@ -0,0 +1,24 @@ +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250-myhost.test.ex Hello CALLER at test.ex
+250-SIZE 52428800
+250-8BITMIME
+250-PIPELINING
+250 HELP
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmaX-0005vi-00
+221 myhost.test.ex closing connection
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
+250-myhost.test.ex Hello CALLER at test.ex
+250-SIZE 52428800
+250-8BITMIME
+250-PIPELINING
+250 HELP
+250 OK
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+550-Your message has been rejected but is being kept for evaluation.
+550-If it was a legitimate message, it may still be delivered to the target
+550 recipient(s).
+221 myhost.test.ex closing connection
|