From b83823bd386eb32cd37b8087429ff58fd21d0f2e Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 22 Sep 2015 11:30:11 +0100 Subject: 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 | 33 -------------------- test/mail/4010.userx | 33 ++++++++++++++++++++ test/scripts/0000-Basic/0568 | 38 ----------------------- test/scripts/4000-scanning/4010 | 38 +++++++++++++++++++++++ test/scripts/4010-scan-ipv6/4010 | 60 ------------------------------------ test/scripts/4010-scan-ipv6/REQUIRES | 2 -- test/scripts/4015-scan-ipv6/4015 | 60 ++++++++++++++++++++++++++++++++++++ test/scripts/4015-scan-ipv6/REQUIRES | 2 ++ test/stdout/0568 | 24 --------------- test/stdout/4010 | 59 ++++++++--------------------------- test/stdout/4015 | 57 ++++++++++++++++++++++++++++++++++ 18 files changed, 272 insertions(+), 271 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 delete mode 100644 test/mail/0568.userx create mode 100644 test/mail/4010.userx delete mode 100644 test/scripts/0000-Basic/0568 create mode 100644 test/scripts/4000-scanning/4010 delete mode 100644 test/scripts/4010-scan-ipv6/4010 delete mode 100644 test/scripts/4010-scan-ipv6/REQUIRES create mode 100644 test/scripts/4015-scan-ipv6/4015 create mode 100644 test/scripts/4015-scan-ipv6/REQUIRES 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/0568.userx deleted file mode 100644 index 59fa44af8..000000000 --- a/test/mail/0568.userx +++ /dev/null @@ -1,33 +0,0 @@ -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 ) - id 10HmaX-0005vi-00 - for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 -From: Test person -To: Me -Subject: A real test message -Date: Tue, 2 Mar 1999 09:44:33 +0000 -Message-ID: <41C2F849.3060203@projectile.test.ex> -Sender: CALLER_NAME - -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 ) - id 10HmaY-0005vi-00 - for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 -From: Test person -To: Me -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 -X-Regex: Regex matched - -OK, this should look like a genuine message, but -it will trip on THIS gazornenplaz REGEX. - diff --git a/test/mail/4010.userx b/test/mail/4010.userx new file mode 100644 index 000000000..59fa44af8 --- /dev/null +++ b/test/mail/4010.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 ) + id 10HmaX-0005vi-00 + for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +From: Test person +To: Me +Subject: A real test message +Date: Tue, 2 Mar 1999 09:44:33 +0000 +Message-ID: <41C2F849.3060203@projectile.test.ex> +Sender: CALLER_NAME + +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 ) + id 10HmaY-0005vi-00 + for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 +From: Test person +To: Me +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 +X-Regex: Regex matched + +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 deleted file mode 100644 index a660f6805..000000000 --- a/test/scripts/0000-Basic/0568 +++ /dev/null @@ -1,38 +0,0 @@ -# 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: -data -From: Test person -To: Me -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: -data -From: Test person -To: Me -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/scripts/4000-scanning/4010 b/test/scripts/4000-scanning/4010 new file mode 100644 index 000000000..a660f6805 --- /dev/null +++ b/test/scripts/4000-scanning/4010 @@ -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: +data +From: Test person +To: Me +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: +data +From: Test person +To: Me +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/scripts/4010-scan-ipv6/4010 b/test/scripts/4010-scan-ipv6/4010 deleted file mode 100644 index 66db933e6..000000000 --- a/test/scripts/4010-scan-ipv6/4010 +++ /dev/null @@ -1,60 +0,0 @@ -# content scan interface: spamassassin / ipv6 -# -# Multiple servers, prioritised, with timeout spec; first one fails -# List separator changed -server 7833 -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 -> -*eof -**** -exim -odi -bs -DOPT='<; 127.0.0.1 7833 ; ::1 7834 pri=2 tmo=2s' -ehlo test.ex -mail from:<> -rcpt to: -data -Content-type: text/plain - -test -. -quit -**** -# -# diff --git a/test/scripts/4010-scan-ipv6/REQUIRES b/test/scripts/4010-scan-ipv6/REQUIRES deleted file mode 100644 index 927190137..000000000 --- a/test/scripts/4010-scan-ipv6/REQUIRES +++ /dev/null @@ -1,2 +0,0 @@ -support Content_Scanning -support IPv6 diff --git a/test/scripts/4015-scan-ipv6/4015 b/test/scripts/4015-scan-ipv6/4015 new file mode 100644 index 000000000..66db933e6 --- /dev/null +++ b/test/scripts/4015-scan-ipv6/4015 @@ -0,0 +1,60 @@ +# content scan interface: spamassassin / ipv6 +# +# Multiple servers, prioritised, with timeout spec; first one fails +# List separator changed +server 7833 +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 +> +*eof +**** +exim -odi -bs -DOPT='<; 127.0.0.1 7833 ; ::1 7834 pri=2 tmo=2s' +ehlo test.ex +mail from:<> +rcpt to: +data +Content-type: text/plain + +test +. +quit +**** +# +# diff --git a/test/scripts/4015-scan-ipv6/REQUIRES b/test/scripts/4015-scan-ipv6/REQUIRES new file mode 100644 index 000000000..927190137 --- /dev/null +++ b/test/scripts/4015-scan-ipv6/REQUIRES @@ -0,0 +1,2 @@ +support Content_Scanning +support IPv6 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 -- cgit v1.2.3