[exim-cvs] Testsuite: case for malware= avast

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Testsuite: case for malware= avast
Gitweb: http://git.exim.org/exim.git/commitdiff/376e377e2de95486a752620f8e52d270cdab5c7c
Commit:     376e377e2de95486a752620f8e52d270cdab5c7c
Parent:     fd02dc0e4e20ecebb0f247641c5aff519bc5e4db
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun Dec 21 21:35:04 2014 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Mon Jan 12 18:58:37 2015 +0000


    Testsuite: case for malware= avast
---
 test/confs/4006                 |   33 ++++++++++++++++
 test/log/4006                   |    8 ++++
 test/paniclog/4006              |    2 +
 test/rejectlog/4006             |   24 ++++++++++++
 test/scripts/4000-scanning/4006 |   80 +++++++++++++++++++++++++++++++++++++++
 test/stderr/4006                |    2 +
 test/stdout/4006                |   64 +++++++++++++++++++++++++++++++
 7 files changed, 213 insertions(+), 0 deletions(-)


diff --git a/test/confs/4006 b/test/confs/4006
new file mode 100644
index 0000000..230f115
--- /dev/null
+++ b/test/confs/4006
@@ -0,0 +1,33 @@
+# Exim test configuration 4002
+# Content-scan: avast interface
+
+exim_path = EXIM_PATH
+host_lookup_order = bydns
+primary_hostname = myhost.test.ex
+spool_directory = DIR/spool
+log_file_path = DIR/spool/log/%slog
+gecos_pattern = ""
+gecos_name = CALLER_NAME
+
+av_scanner = avast : DIR/eximdir/avast_sock : OPTION
+
+# ----- Main settings -----
+
+acl_smtp_rcpt = accept
+acl_smtp_data = c_data
+
+begin acl
+
+c_data:
+  accept !malware = *
+  deny     logwrite = malware_name $malware_name
+
+# ----- Routers -----
+
+begin routers
+
+r:
+  driver = redirect
+  data = :blackhole:
+
+# End
diff --git a/test/log/4006 b/test/log/4006
new file mode 100644
index 0000000..4304b87
--- /dev/null
+++ b/test/log/4006
@@ -0,0 +1,8 @@
+1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@??? U=CALLER P=local-esmtp S=sss
+1999-03-02 09:44:33 10HmaZ-0005vi-00 => :blackhole: <userx@???> R=r
+1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaX-0005vi-00 malware acl condition: avast: invalid response from scanner: blah    [E]
+
+1999-03-02 09:44:33 10HmaX-0005vi-00 U=CALLER F=<CALLER@???> temporarily rejected after DATA
+1999-03-02 09:44:33 10HmaY-0005vi-00 malware_name VNAME
+1999-03-02 09:44:33 10HmaY-0005vi-00 U=CALLER F=<CALLER@???> rejected after DATA
diff --git a/test/paniclog/4006 b/test/paniclog/4006
new file mode 100644
index 0000000..24ab948
--- /dev/null
+++ b/test/paniclog/4006
@@ -0,0 +1,2 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 malware acl condition: avast: invalid response from scanner: blah    [E]
+
diff --git a/test/rejectlog/4006 b/test/rejectlog/4006
new file mode 100644
index 0000000..2054abd
--- /dev/null
+++ b/test/rejectlog/4006
@@ -0,0 +1,24 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 U=CALLER F=<CALLER@???> temporarily rejected after DATA
+Envelope-from: <CALLER@???>
+Envelope-to: <userx@???>
+P Received: from CALLER (helo=test.ex)
+    by myhost.test.ex with local-esmtp (Exim x.yz)
+    (envelope-from <CALLER@???>)
+    id 10HmaX-0005vi-00
+    for userx@???; Tue, 2 Mar 1999 09:44:33 +0000
+  Date: Tue, 2 Mar 1999 09:44:33 +0000
+  Subject: defer this one
+I Message-Id: <E10HmaX-0005vi-00@???>
+F From: CALLER_NAME <CALLER@???>
+1999-03-02 09:44:33 10HmaY-0005vi-00 U=CALLER F=<CALLER@???> rejected after DATA
+Envelope-from: <CALLER@???>
+Envelope-to: <userx@???>
+P Received: from CALLER (helo=test.ex)
+    by myhost.test.ex with local-esmtp (Exim x.yz)
+    (envelope-from <CALLER@???>)
+    id 10HmaY-0005vi-00
+    for userx@???; Tue, 2 Mar 1999 09:44:33 +0000
+  Date: Tue, 2 Mar 1999 09:44:33 +0000
+  Subject: message should be rejected
+I Message-Id: <E10HmaY-0005vi-00@???>
+F From: CALLER_NAME <CALLER@???>
diff --git a/test/scripts/4000-scanning/4006 b/test/scripts/4000-scanning/4006
new file mode 100644
index 0000000..af9af49
--- /dev/null
+++ b/test/scripts/4000-scanning/4006
@@ -0,0 +1,80 @@
+# content scan interface: avast
+#
+server DIR/eximdir/avast_sock
+>LF>220 ready
+<FLAGS -fullfiles
+>LF>210 FLAGS DATA
+>LF>200 FLAGS OK
+<SCAN
+>LF>210 SCAN DATA
+>LF>blah    [+]
+>LF>200 SCAN OK
+<QUIT
+<*eof
+****
+#
+#
+#
+exim -odi -bs -DOPTION="FLAGS -fullfiles"
+ehlo test.ex
+mail from:<>
+rcpt to:<userx@???>
+data
+Date: Fri, 17 Dec 2004 14:35:01 +0100
+Subject: message should be accepted
+
+.
+quit
+****
+#
+#
+#
+server DIR/eximdir/avast_sock
+>LF>220 ready
+<SCAN
+>LF>210 SCAN DATA
+>LF>blah    [E]
+>LF>200 SCAN OK
+<QUIT
+<*eof
+****
+#
+#
+#
+exim -odi -bs -DOPTION=
+ehlo test.ex
+mail from:<>
+rcpt to:<userx@???>
+data
+Date: Fri, 17 Dec 2004 14:35:01 +0100
+Subject: defer this one
+
+.
+quit
+****
+#
+#
+#
+server DIR/eximdir/avast_sock
+>LF>220 ready
+<SCAN
+>LF>210 SCAN DATA
+>LF>b\ l\ a\ h    [L]9.9    9 VNAME
+>LF>200 SCAN OK
+<QUIT
+<*eof
+****
+#
+#
+#
+exim -odi -bs -DOPTION=
+ehlo test.ex
+mail from:<>
+rcpt to:<userx@???>
+data
+Date: Fri, 17 Dec 2004 14:35:01 +0100
+Subject: message should be rejected
+
+.
+quit
+****
diff --git a/test/stderr/4006 b/test/stderr/4006
new file mode 100644
index 0000000..24ab948
--- /dev/null
+++ b/test/stderr/4006
@@ -0,0 +1,2 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 malware acl condition: avast: invalid response from scanner: blah    [E]
+
diff --git a/test/stdout/4006 b/test/stdout/4006
new file mode 100644
index 0000000..602afa6
--- /dev/null
+++ b/test/stdout/4006
@@ -0,0 +1,64 @@
+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=10HmaZ-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
+451 Temporary local problem - please try later
+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 Administrative prohibition
+221 myhost.test.ex closing connection
+
+******** SERVER ********
+Listening on TESTSUITE/eximdir/avast_sock ... 
+Connection request
+>LF>220 ready
+<FLAGS -fullfiles
+>LF>210 FLAGS DATA
+>LF>200 FLAGS OK
+<SCAN TESTSUITE/spool/scan/10HmaZ-0005vi-00
+>LF>210 SCAN DATA
+>LF>blah    [+]
+>LF>200 SCAN OK
+<QUIT
+Unexpected EOF read from client
+End of script
+Listening on TESTSUITE/eximdir/avast_sock ... 
+Connection request
+>LF>220 ready
+<SCAN TESTSUITE/spool/scan/10HmaX-0005vi-00
+>LF>210 SCAN DATA
+>LF>blah    [E]
+>LF>200 SCAN OK
+Unexpected EOF read from client
+Listening on TESTSUITE/eximdir/avast_sock ... 
+Connection request
+>LF>220 ready
+<SCAN TESTSUITE/spool/scan/10HmaY-0005vi-00
+>LF>210 SCAN DATA
+>LF>b\ l\ a\ h    [L]9.9    9 VNAME
+>LF>200 SCAN OK
+Unexpected EOF read from client