From b83823bd386eb32cd37b8087429ff58fd21d0f2e Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 22 Sep 2015 11:30:11 +0100 Subject: [PATCH] Testsuite: move regex testcase to Content-scanning section --- src/src/EDITME | 1 + test/confs/0568 | 57 ------------------ test/confs/4010 | 58 +++++++++++++++++- test/confs/4015 | 1 + test/log/0568 | 6 -- test/log/4010 | 9 +-- test/log/4015 | 5 ++ test/mail/{0568.userx => 4010.userx} | 0 .../{0000-Basic/0568 => 4000-scanning/4010} | 0 .../4010 => 4015-scan-ipv6/4015} | 0 .../REQUIRES | 0 test/stdout/0568 | 24 -------- test/stdout/4010 | 59 ++++--------------- test/stdout/4015 | 57 ++++++++++++++++++ 14 files changed, 139 insertions(+), 138 deletions(-) delete mode 100644 test/confs/0568 mode change 120000 => 100644 test/confs/4010 create mode 120000 test/confs/4015 delete mode 100644 test/log/0568 create mode 100644 test/log/4015 rename test/mail/{0568.userx => 4010.userx} (100%) rename test/scripts/{0000-Basic/0568 => 4000-scanning/4010} (100%) rename test/scripts/{4010-scan-ipv6/4010 => 4015-scan-ipv6/4015} (100%) rename test/scripts/{4010-scan-ipv6 => 4015-scan-ipv6}/REQUIRES (100%) delete mode 100644 test/stdout/0568 create mode 100644 test/stdout/4015 diff --git a/src/src/EDITME b/src/src/EDITME index d4811225a..c2d95ff40 100644 --- a/src/src/EDITME +++ b/src/src/EDITME @@ -438,6 +438,7 @@ EXIM_MONITOR=eximon.bin # Uncomment the following line to add support for talking to dccifd. This # defaults the socket path to /usr/local/dcc/var/dccifd. +# Doing so will also explicitly turn on the WITH_CONTENT_SCAN option. # EXPERIMENTAL_DCC=yes diff --git a/test/confs/0568 b/test/confs/0568 deleted file mode 100644 index fb1ec5d6e..000000000 --- a/test/confs/0568 +++ /dev/null @@ -1,57 +0,0 @@ -# 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 ----- - -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/confs/4010 b/test/confs/4010 deleted file mode 120000 index eb8888460..000000000 --- a/test/confs/4010 +++ /dev/null @@ -1 +0,0 @@ -4009 \ No newline at end of file diff --git a/test/confs/4010 b/test/confs/4010 new file mode 100644 index 000000000..fb1ec5d6e --- /dev/null +++ b/test/confs/4010 @@ -0,0 +1,57 @@ +# 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 ----- + +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/confs/4015 b/test/confs/4015 new file mode 120000 index 000000000..eb8888460 --- /dev/null +++ b/test/confs/4015 @@ -0,0 +1 @@ +4009 \ No newline at end of file diff --git a/test/log/0568 b/test/log/0568 deleted file mode 100644 index 1ab5847e6..000000000 --- a/test/log/0568 +++ /dev/null @@ -1,6 +0,0 @@ -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 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 R=r1 T=t1 -1999-03-02 09:44:33 10HmaY-0005vi-00 Completed diff --git a/test/log/4010 b/test/log/4010 index c522ef82f..1ab5847e6 100644 --- a/test/log/4010 +++ b/test/log/4010 @@ -1,5 +1,6 @@ -1999-03-02 09:44:33 10HmaX-0005vi-00 spam acl condition: spamd: failed to connect to any address for ::1: Connection refused -1999-03-02 09:44:33 10HmaX-0005vi-00 U=CALLER Warning: [127.0.0.1]:1111 no action Spam detection software, running on the system "demo",\n has NOT identified this incoming email as spam. The original\n message has been attached to this so you can view it or label\n similar future email. If you have any questions, see\n @@CONTACT_ADDRESS@@ for details.\n \n Content preview: test [...]\n \n Content analysis details: (4.5 points, 5.0 required)\n \n pts rule name description\n ---- ---------------------- --------------------------------------------------\n -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP\n 1.2 MISSING_HEADERS Missing To: header\n 1.0 MISSING_FROM Missing From: header\n 1.8 MISSING_SUBJECT Missing Subject: header\n 1.4 MISSING_DATE Missing Date: header\n 0.1 MISSING_MID Missing Message-Id: header -1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss -1999-03-02 09:44:33 10HmaX-0005vi-00 => :blackhole: R=r +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 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 R=r1 T=t1 +1999-03-02 09:44:33 10HmaY-0005vi-00 Completed diff --git a/test/log/4015 b/test/log/4015 new file mode 100644 index 000000000..c522ef82f --- /dev/null +++ b/test/log/4015 @@ -0,0 +1,5 @@ +1999-03-02 09:44:33 10HmaX-0005vi-00 spam acl condition: spamd: failed to connect to any address for ::1: Connection refused +1999-03-02 09:44:33 10HmaX-0005vi-00 U=CALLER Warning: [127.0.0.1]:1111 no action Spam detection software, running on the system "demo",\n has NOT identified this incoming email as spam. The original\n message has been attached to this so you can view it or label\n similar future email. If you have any questions, see\n @@CONTACT_ADDRESS@@ for details.\n \n Content preview: test [...]\n \n Content analysis details: (4.5 points, 5.0 required)\n \n pts rule name description\n ---- ---------------------- --------------------------------------------------\n -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP\n 1.2 MISSING_HEADERS Missing To: header\n 1.0 MISSING_FROM Missing From: header\n 1.8 MISSING_SUBJECT Missing Subject: header\n 1.4 MISSING_DATE Missing Date: header\n 0.1 MISSING_MID Missing Message-Id: header +1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss +1999-03-02 09:44:33 10HmaX-0005vi-00 => :blackhole: R=r +1999-03-02 09:44:33 10HmaX-0005vi-00 Completed diff --git a/test/mail/0568.userx b/test/mail/4010.userx similarity index 100% rename from test/mail/0568.userx rename to test/mail/4010.userx diff --git a/test/scripts/0000-Basic/0568 b/test/scripts/4000-scanning/4010 similarity index 100% rename from test/scripts/0000-Basic/0568 rename to test/scripts/4000-scanning/4010 diff --git a/test/scripts/4010-scan-ipv6/4010 b/test/scripts/4015-scan-ipv6/4015 similarity index 100% rename from test/scripts/4010-scan-ipv6/4010 rename to test/scripts/4015-scan-ipv6/4015 diff --git a/test/scripts/4010-scan-ipv6/REQUIRES b/test/scripts/4015-scan-ipv6/REQUIRES similarity index 100% rename from test/scripts/4010-scan-ipv6/REQUIRES rename to test/scripts/4015-scan-ipv6/REQUIRES diff --git a/test/stdout/0568 b/test/stdout/0568 deleted file mode 100644 index 2db3157dd..000000000 --- a/test/stdout/0568 +++ /dev/null @@ -1,24 +0,0 @@ -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 diff --git a/test/stdout/4010 b/test/stdout/4010 index a1d7f2ea7..2db3157dd 100644 --- a/test/stdout/4010 +++ b/test/stdout/4010 @@ -9,49 +9,16 @@ 354 Enter message, ending with "." on a line by itself 250 OK id=10HmaX-0005vi-00 221 myhost.test.ex closing connection - -******** SERVER ******** -Listening on port 7833 ... -Connection request from [127.0.0.1] - -) -< id 10HmaX-0005vi-00 -< for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 - - -SPAMD/1.1 0 EX_OK ->Spam: False ; 4.5 / 5.0 -> ->Spam detection software, running on the system "demo", ->has NOT identified this incoming email as spam. The original ->message has been attached to this so you can view it or label ->similar future email. If you have any questions, see ->@@CONTACT_ADDRESS@@ for details. -> ->Content preview: test [...] -> ->Content analysis details: (4.5 points, 5.0 required) -> -> pts rule name description ->---- ---------------------- -------------------------------------------------- ->-1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -> 1.2 MISSING_HEADERS Missing To: header -> 1.0 MISSING_FROM Missing From: header -> 1.8 MISSING_SUBJECT Missing Subject: header -> 1.4 MISSING_DATE Missing Date: header -> 0.1 MISSING_MID Missing Message-Id: header -> -Expected EOF read from client -End of script +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 diff --git a/test/stdout/4015 b/test/stdout/4015 new file mode 100644 index 000000000..a1d7f2ea7 --- /dev/null +++ b/test/stdout/4015 @@ -0,0 +1,57 @@ +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 + +******** SERVER ******** +Listening on port 7833 ... +Connection request from [127.0.0.1] + +) +< id 10HmaX-0005vi-00 +< for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 + + +SPAMD/1.1 0 EX_OK +>Spam: False ; 4.5 / 5.0 +> +>Spam detection software, running on the system "demo", +>has NOT identified this incoming email as spam. The original +>message has been attached to this so you can view it or label +>similar future email. If you have any questions, see +>@@CONTACT_ADDRESS@@ for details. +> +>Content preview: test [...] +> +>Content analysis details: (4.5 points, 5.0 required) +> +> pts rule name description +>---- ---------------------- -------------------------------------------------- +>-1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP +> 1.2 MISSING_HEADERS Missing To: header +> 1.0 MISSING_FROM Missing From: header +> 1.8 MISSING_SUBJECT Missing Subject: header +> 1.4 MISSING_DATE Missing Date: header +> 0.1 MISSING_MID Missing Message-Id: header +> +Expected EOF read from client +End of script -- 2.30.2