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

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= cmdline
Gitweb: http://git.exim.org/exim.git/commitdiff/093632c96953bfc8fb96d607e0605534efa64252
Commit:     093632c96953bfc8fb96d607e0605534efa64252
Parent:     bfbad1dddf8b26ef0e14e48a36edc4a8bf1425e4
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sat Dec 27 20:35:08 2014 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sat Dec 27 20:42:13 2014 +0000


    Testsuite: case for malware= cmdline
---
 test/aux-fixed/4007.script      |   22 ++++++++++++++++++++++
 test/confs/4007                 |   33 +++++++++++++++++++++++++++++++++
 test/log/4007                   |    5 +++++
 test/rejectlog/4007             |   12 ++++++++++++
 test/scripts/4000-scanning/4007 |   28 ++++++++++++++++++++++++++++
 test/stdout/4007                |   22 ++++++++++++++++++++++
 6 files changed, 122 insertions(+), 0 deletions(-)


diff --git a/test/aux-fixed/4007.script b/test/aux-fixed/4007.script
new file mode 100755
index 0000000..9cdd098
--- /dev/null
+++ b/test/aux-fixed/4007.script
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+if [ x$1 = "x-o" ]
+then
+  shift
+  action=$1
+  shift
+fi
+
+if [ -r $1 ]
+then
+  echo "scanning file $1"
+else
+  echo "$1 not readable"
+  exit 1
+fi
+
+case $action in
+accept) ;;
+reject) echo "VNAME found in file $1";;
+esac
+
diff --git a/test/confs/4007 b/test/confs/4007
new file mode 100644
index 0000000..576c008
--- /dev/null
+++ b/test/confs/4007
@@ -0,0 +1,33 @@
+# Exim test configuration 4007
+# Content-scan: cmsline 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 = cmdline : DIR/aux-fixed/TESTNUM.script -o OPT %s : found in file : ^(\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/log/4007 b/test/log/4007
new file mode 100644
index 0000000..1425f52
--- /dev/null
+++ b/test/log/4007
@@ -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/rejectlog/4007 b/test/rejectlog/4007
new file mode 100644
index 0000000..bd26ac2
--- /dev/null
+++ b/test/rejectlog/4007
@@ -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/scripts/4000-scanning/4007 b/test/scripts/4000-scanning/4007
new file mode 100644
index 0000000..7bf6aca
--- /dev/null
+++ b/test/scripts/4000-scanning/4007
@@ -0,0 +1,28 @@
+# content scan interface: cmdline
+#
+#
+exim -DOPT=accept -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
+****
+#
+#
+#
+exim -DOPT=reject -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/stdout/4007 b/test/stdout/4007
new file mode 100644
index 0000000..3552795
--- /dev/null
+++ b/test/stdout/4007
@@ -0,0 +1,22 @@
+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