[exim-cvs] Testsuite: cases for malware= interfaces to f-pro…

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Testsuite: cases for malware= interfaces to f-protd, aveserver, fsecure, soophie & clamav
Gitweb: http://git.exim.org/exim.git/commitdiff/a60f6c07eea74e79b88828295a191e79595d8960
Commit:     a60f6c07eea74e79b88828295a191e79595d8960
Parent:     21bc4865a31e8fba169d6da095890f842fc0643a
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun Dec 21 21:32:13 2014 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun Dec 21 21:36:47 2014 +0000


    Testsuite: cases for malware= interfaces to f-protd, aveserver, fsecure, soophie & clamav


    There are running against scripts not the rea thing
    so only useful for spotting gross breakage.
---
 test/confs/4001                 |   33 +++++++++++++++++
 test/confs/4002                 |   33 +++++++++++++++++
 test/confs/4003                 |   33 +++++++++++++++++
 test/confs/4004                 |   33 +++++++++++++++++
 test/confs/4005                 |   33 +++++++++++++++++
 test/log/4001                   |    5 +++
 test/log/4002                   |    7 ++++
 test/log/4003                   |    5 +++
 test/log/4004                   |    7 ++++
 test/log/4005                   |    7 ++++
 test/paniclog/4002              |    1 +
 test/paniclog/4004              |    1 +
 test/paniclog/4005              |    1 +
 test/rejectlog/4001             |   12 ++++++
 test/rejectlog/4002             |   24 ++++++++++++
 test/rejectlog/4003             |   12 ++++++
 test/rejectlog/4004             |   24 ++++++++++++
 test/rejectlog/4005             |   24 ++++++++++++
 test/scripts/4000-scanning/4001 |   50 ++++++++++++++++++++++++++
 test/scripts/4000-scanning/4002 |   75 +++++++++++++++++++++++++++++++++++++++
 test/scripts/4000-scanning/4003 |   62 ++++++++++++++++++++++++++++++++
 test/scripts/4000-scanning/4004 |   65 +++++++++++++++++++++++++++++++++
 test/scripts/4000-scanning/4005 |   67 ++++++++++++++++++++++++++++++++++
 test/stderr/4002                |    1 +
 test/stderr/4004                |    1 +
 test/stderr/4005                |    1 +
 test/stdout/4001                |   43 ++++++++++++++++++++++
 test/stdout/4002                |   63 ++++++++++++++++++++++++++++++++
 test/stdout/4003                |   55 ++++++++++++++++++++++++++++
 test/stdout/4004                |   53 +++++++++++++++++++++++++++
 test/stdout/4005                |   53 +++++++++++++++++++++++++++
 31 files changed, 884 insertions(+), 0 deletions(-)


diff --git a/test/confs/4001 b/test/confs/4001
new file mode 100644
index 0000000..39e7705
--- /dev/null
+++ b/test/confs/4001
@@ -0,0 +1,33 @@
+# Exim test configuration 4001
+# Content-scan: f-protd 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 = f-protd : localhost PORT_S
+
+# ----- 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/confs/4002 b/test/confs/4002
new file mode 100644
index 0000000..5ebb937
--- /dev/null
+++ b/test/confs/4002
@@ -0,0 +1,33 @@
+# Exim test configuration 4002
+# Content-scan: aveserver 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 = aveserver : DIR/eximdir/aveserver_sock
+
+# ----- 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/confs/4003 b/test/confs/4003
new file mode 100644
index 0000000..e2d65ba
--- /dev/null
+++ b/test/confs/4003
@@ -0,0 +1,33 @@
+# Exim test configuration 4002
+# Content-scan: fsecure 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 = fsecure : DIR/eximdir/fsec_sock
+
+# ----- 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/confs/4004 b/test/confs/4004
new file mode 100644
index 0000000..22cbbd0
--- /dev/null
+++ b/test/confs/4004
@@ -0,0 +1,33 @@
+# Exim test configuration 4002
+# Content-scan: sophie 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 = sophie : DIR/eximdir/sophie_sock
+
+# ----- 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/confs/4005 b/test/confs/4005
new file mode 100644
index 0000000..6d0b797
--- /dev/null
+++ b/test/confs/4005
@@ -0,0 +1,33 @@
+# Exim test configuration 4002
+# Content-scan: clamav 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 = clamd : DIR/eximdir/clam_sock
+
+# ----- 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/4001 b/test/log/4001
new file mode 100644
index 0000000..f478b27
--- /dev/null
+++ b/test/log/4001
@@ -0,0 +1,5 @@
+1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@??? U=CALLER P=local-esmtp S=sss
+1999-03-02 09:44:33 10HmaY-0005vi-00 => :blackhole: <userx@???> R=r
+1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaX-0005vi-00 malware_name wibble
+1999-03-02 09:44:33 10HmaX-0005vi-00 U=CALLER F=<CALLER@???> rejected after DATA
diff --git a/test/log/4002 b/test/log/4002
new file mode 100644
index 0000000..5ea545d
--- /dev/null
+++ b/test/log/4002
@@ -0,0 +1,7 @@
+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: aveserver: unable to scan file TESTSUITE/spool/scan/10HmaX-0005vi-00/10HmaX-0005vi-00.eml (Responded: 5xx defer).
+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/log/4003 b/test/log/4003
new file mode 100644
index 0000000..1425f52
--- /dev/null
+++ b/test/log/4003
@@ -0,0 +1,5 @@
+1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@??? U=CALLER P=local-esmtp S=sss
+1999-03-02 09:44:33 10HmaY-0005vi-00 => :blackhole: <userx@???> R=r
+1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaX-0005vi-00 malware_name VNAME
+1999-03-02 09:44:33 10HmaX-0005vi-00 U=CALLER F=<CALLER@???> rejected after DATA
diff --git a/test/log/4004 b/test/log/4004
new file mode 100644
index 0000000..624fb32
--- /dev/null
+++ b/test/log/4004
@@ -0,0 +1,7 @@
+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: sophie: scanner reported error
+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/log/4005 b/test/log/4005
new file mode 100644
index 0000000..7e2dac2
--- /dev/null
+++ b/test/log/4005
@@ -0,0 +1,7 @@
+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: clamd: ClamAV returned: scanned_file_name: 666 ERROR
+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/4002 b/test/paniclog/4002
new file mode 100644
index 0000000..0fd411c
--- /dev/null
+++ b/test/paniclog/4002
@@ -0,0 +1 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 malware acl condition: aveserver: unable to scan file TESTSUITE/spool/scan/10HmaX-0005vi-00/10HmaX-0005vi-00.eml (Responded: 5xx defer).
diff --git a/test/paniclog/4004 b/test/paniclog/4004
new file mode 100644
index 0000000..1b8d844
--- /dev/null
+++ b/test/paniclog/4004
@@ -0,0 +1 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 malware acl condition: sophie: scanner reported error
diff --git a/test/paniclog/4005 b/test/paniclog/4005
new file mode 100644
index 0000000..12b19bc
--- /dev/null
+++ b/test/paniclog/4005
@@ -0,0 +1 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 malware acl condition: clamd: ClamAV returned: scanned_file_name: 666 ERROR
diff --git a/test/rejectlog/4001 b/test/rejectlog/4001
new file mode 100644
index 0000000..bd26ac2
--- /dev/null
+++ b/test/rejectlog/4001
@@ -0,0 +1,12 @@
+1999-03-02 09:44:33 10HmaX-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 10HmaX-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: <E10HmaX-0005vi-00@???>
+F From: CALLER_NAME <CALLER@???>
diff --git a/test/rejectlog/4002 b/test/rejectlog/4002
new file mode 100644
index 0000000..2054abd
--- /dev/null
+++ b/test/rejectlog/4002
@@ -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/rejectlog/4003 b/test/rejectlog/4003
new file mode 100644
index 0000000..bd26ac2
--- /dev/null
+++ b/test/rejectlog/4003
@@ -0,0 +1,12 @@
+1999-03-02 09:44:33 10HmaX-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 10HmaX-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: <E10HmaX-0005vi-00@???>
+F From: CALLER_NAME <CALLER@???>
diff --git a/test/rejectlog/4004 b/test/rejectlog/4004
new file mode 100644
index 0000000..2054abd
--- /dev/null
+++ b/test/rejectlog/4004
@@ -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/rejectlog/4005 b/test/rejectlog/4005
new file mode 100644
index 0000000..2054abd
--- /dev/null
+++ b/test/rejectlog/4005
@@ -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/4001 b/test/scripts/4000-scanning/4001
new file mode 100644
index 0000000..0234a3d
--- /dev/null
+++ b/test/scripts/4000-scanning/4001
@@ -0,0 +1,50 @@
+# content scan interface: f-protd
+#
+server PORT_S
+<GET
+<
+><summary code="11">
+>*eof
+****
+#
+#
+#
+exim -odi -bs
+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 PORT_S
+<GET
+<
+>
+>
+>
+><detected type="foo">
+><name>wibble</name>
+><summary code="11">
+>*eof
+****
+#
+#
+#
+exim -odi -bs
+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/scripts/4000-scanning/4002 b/test/scripts/4000-scanning/4002
new file mode 100644
index 0000000..201fdf1
--- /dev/null
+++ b/test/scripts/4000-scanning/4002
@@ -0,0 +1,75 @@
+# content scan interface: aveserver
+#
+server DIR/eximdir/aveserver_sock
+>200 ready
+<SCAN
+>200 done
+<quit
+>200 ready
+*eof
+****
+#
+#
+#
+exim -odi -bs
+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/aveserver_sock
+>2xx ready
+<SCAN
+>5xx defer
+<quit
+>2xx ready
+*eof
+****
+#
+#
+#
+exim -odi -bs
+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/aveserver_sock
+>2xx ready
+<SCAN
+>322 VNAME found
+>2xx ready
+<quit
+>2xx ready
+*eof
+****
+#
+#
+#
+exim -odi -bs
+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/scripts/4000-scanning/4003 b/test/scripts/4000-scanning/4003
new file mode 100644
index 0000000..0bfa14e
--- /dev/null
+++ b/test/scripts/4000-scanning/4003
@@ -0,0 +1,62 @@
+# content scan interface: fsecure
+#
+server DIR/eximdir/fsec_sock
+<CONFIGURE
+>ignored_response
+<CONFIGURE
+>ignored_response
+<CONFIGURE
+>ignored_response
+<CONFIGURE
+>ignored_response
+<SCAN
+>LF>random ignored line
+>LF>random ignored line 2
+>LF>OK    Scan ok.
+*eof
+****
+#
+#
+#
+exim -odi -bs
+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/fsec_sock
+<CONFIGURE
+>ignored_response
+<CONFIGURE
+>ignored_response
+<CONFIGURE
+>ignored_response
+<CONFIGURE
+>ignored_response
+<SCAN
+>LF>xxxINFECTED    blah    VNAME    blah
+>LF>OK    Scan ok.
+*eof
+****
+#
+#
+#
+exim -odi -bs
+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/scripts/4000-scanning/4004 b/test/scripts/4000-scanning/4004
new file mode 100644
index 0000000..e6a1429
--- /dev/null
+++ b/test/scripts/4000-scanning/4004
@@ -0,0 +1,65 @@
+# content scan interface: sophie
+#
+server DIR/eximdir/sophie_sock
+</
+>0 no problems mate
+*eof
+****
+#
+#
+#
+exim -odi -bs
+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/sophie_sock
+</
+>-1 oops, internal error in scanner
+*eof
+****
+#
+#
+#
+exim -odi -bs
+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/sophie_sock
+</
+>LF>1 VNAME
+*eof
+****
+#
+#
+#
+exim -odi -bs
+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/scripts/4000-scanning/4005 b/test/scripts/4000-scanning/4005
new file mode 100644
index 0000000..32a281b
--- /dev/null
+++ b/test/scripts/4000-scanning/4005
@@ -0,0 +1,67 @@
+# content scan interface: clamav
+#
+# SCAN command interface, on a unix socket, only.  No ExtendedDetectionInfo.
+#
+server DIR/eximdir/clam_sock
+<SCAN
+>LF>scanned_file_name: OK
+<*eof
+****
+#
+#
+#
+exim -odi -bs
+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/clam_sock
+<SCAN
+>LF>scanned_file_name: 666 ERROR
+<*eof
+****
+#
+#
+#
+exim -odi -bs
+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/clam_sock
+<SCAN
+>LF>scanned_file_name: VNAME FOUND
+<*eof
+****
+#
+#
+#
+exim -odi -bs
+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/4002 b/test/stderr/4002
new file mode 100644
index 0000000..0fd411c
--- /dev/null
+++ b/test/stderr/4002
@@ -0,0 +1 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 malware acl condition: aveserver: unable to scan file TESTSUITE/spool/scan/10HmaX-0005vi-00/10HmaX-0005vi-00.eml (Responded: 5xx defer).
diff --git a/test/stderr/4004 b/test/stderr/4004
new file mode 100644
index 0000000..1b8d844
--- /dev/null
+++ b/test/stderr/4004
@@ -0,0 +1 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 malware acl condition: sophie: scanner reported error
diff --git a/test/stderr/4005 b/test/stderr/4005
new file mode 100644
index 0000000..12b19bc
--- /dev/null
+++ b/test/stderr/4005
@@ -0,0 +1 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 malware acl condition: clamd: ClamAV returned: scanned_file_name: 666 ERROR
diff --git a/test/stdout/4001 b/test/stdout/4001
new file mode 100644
index 0000000..2e84f98
--- /dev/null
+++ b/test/stdout/4001
@@ -0,0 +1,43 @@
+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=10HmaY-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 Administrative prohibition
+221 myhost.test.ex closing connection
+
+******** SERVER ********
+Listening on port 1224 ... 
+Connection request from [127.0.0.1]
+<GET TESTSUITE/spool/scan/10HmaY-0005vi-00/10HmaY-0005vi-00.eml HTTP/1.0
+<
+><summary code="11">
+>*eof
+End of script
+Listening on port 1224 ... 
+Connection request from [127.0.0.1]
+<GET TESTSUITE/spool/scan/10HmaX-0005vi-00/10HmaX-0005vi-00.eml HTTP/1.0
+<
+>
+>
+>
+><detected type="foo">
+><name>wibble</name>
+><summary code="11">
+>*eof
+End of script
diff --git a/test/stdout/4002 b/test/stdout/4002
new file mode 100644
index 0000000..1987803
--- /dev/null
+++ b/test/stdout/4002
@@ -0,0 +1,63 @@
+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/aveserver_sock ... 
+Connection request
+>200 ready
+<SCAN bPQRSTUW TESTSUITE/spool/scan/10HmaZ-0005vi-00/10HmaZ-0005vi-00.eml
+>200 done
+<quit
+>200 ready
+Expected EOF read from client
+End of script
+Listening on TESTSUITE/eximdir/aveserver_sock ... 
+Connection request
+>2xx ready
+<SCAN bPQRSTUW TESTSUITE/spool/scan/10HmaX-0005vi-00/10HmaX-0005vi-00.eml
+>5xx defer
+<quit
+>2xx ready
+Expected EOF read from client
+End of script
+Listening on TESTSUITE/eximdir/aveserver_sock ... 
+Connection request
+>2xx ready
+<SCAN bPQRSTUW TESTSUITE/spool/scan/10HmaY-0005vi-00/10HmaY-0005vi-00.eml
+>322 VNAME found
+>2xx ready
+<quit
+>2xx ready
+Expected EOF read from client
+End of script
diff --git a/test/stdout/4003 b/test/stdout/4003
new file mode 100644
index 0000000..e0241c1
--- /dev/null
+++ b/test/stdout/4003
@@ -0,0 +1,55 @@
+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=10HmaY-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 Administrative prohibition
+221 myhost.test.ex closing connection
+
+******** SERVER ********
+Listening on TESTSUITE/eximdir/fsec_sock ... 
+Connection request
+<CONFIGURE    ARCHIVE    1
+>ignored_response
+<CONFIGURE    TIMEOUT    0
+>ignored_response
+<CONFIGURE    MAXARCH    5
+>ignored_response
+<CONFIGURE    MIME    1
+>ignored_response
+<SCAN    TESTSUITE/spool/scan/10HmaY-0005vi-00/10HmaY-0005vi-00.eml
+>LF>random ignored line
+>LF>random ignored line 2
+>LF>OK    Scan ok.
+Expected EOF read from client
+End of script
+Listening on TESTSUITE/eximdir/fsec_sock ... 
+Connection request
+<CONFIGURE    ARCHIVE    1
+>ignored_response
+<CONFIGURE    TIMEOUT    0
+>ignored_response
+<CONFIGURE    MAXARCH    5
+>ignored_response
+<CONFIGURE    MIME    1
+>ignored_response
+<SCAN    TESTSUITE/spool/scan/10HmaX-0005vi-00/10HmaX-0005vi-00.eml
+>LF>xxxINFECTED    blah    VNAME    blah
+>LF>OK    Scan ok.
+Expected EOF read from client
+End of script
diff --git a/test/stdout/4004 b/test/stdout/4004
new file mode 100644
index 0000000..ceeb9e2
--- /dev/null
+++ b/test/stdout/4004
@@ -0,0 +1,53 @@
+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/sophie_sock ... 
+Connection request
+<TESTSUITE/spool/scan/10HmaZ-0005vi-00
+>0 no problems mate
+Expected EOF read from client
+End of script
+Listening on TESTSUITE/eximdir/sophie_sock ... 
+Connection request
+<TESTSUITE/spool/scan/10HmaX-0005vi-00
+>-1 oops, internal error in scanner
+Expected EOF read from client
+End of script
+Listening on TESTSUITE/eximdir/sophie_sock ... 
+Connection request
+<TESTSUITE/spool/scan/10HmaY-0005vi-00
+>LF>1 VNAME
+Expected EOF read from client
+End of script
diff --git a/test/stdout/4005 b/test/stdout/4005
new file mode 100644
index 0000000..7b7dbdc
--- /dev/null
+++ b/test/stdout/4005
@@ -0,0 +1,53 @@
+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/clam_sock ... 
+Connection request
+<SCAN TESTSUITE/spool/scan/10HmaZ-0005vi-00/10HmaZ-0005vi-00.eml
+>LF>scanned_file_name: OK
+Unexpected EOF read from client
+End of script
+Listening on TESTSUITE/eximdir/clam_sock ... 
+Connection request
+<SCAN TESTSUITE/spool/scan/10HmaX-0005vi-00/10HmaX-0005vi-00.eml
+>LF>scanned_file_name: 666 ERROR
+Unexpected EOF read from client
+End of script
+Listening on TESTSUITE/eximdir/clam_sock ... 
+Connection request
+<SCAN TESTSUITE/spool/scan/10HmaY-0005vi-00/10HmaY-0005vi-00.eml
+>LF>scanned_file_name: VNAME FOUND
+Unexpected EOF read from client
+End of script