~ubuntu-branches/ubuntu/quantal/dovecot/quantal

« back to all changes in this revision

Viewing changes to sieve/tests/extensions/spamvirustest/virustest.svtest

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short, Scott Kitterman
  • Date: 2010-06-22 10:33:51 UTC
  • mfrom: (1.13.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100622103351-ifbmnklp8kxrhb30
Tags: 1:1.2.12-0ubuntu1
* New upstream release:
  - deliver: Don't crash when a message with Auto-submitted: header gets
   rejected.
  - lib-storage: Fixed header searches to work correctly when there are
    multiple headers with same name.
  - dict client: Disconnect from dict server after 1 second of idling.
  - dict: If process crashed, it wasn't automatically restarted
  - dict file: If dict file's group permissions equal world permissions,
    don't try to change its gid.
  - maildir: Fixed a memory leak when copying with hardlinks.
  - maildir: Expunging last messages may have assert-crashed if their
    filenames had just changed.
 * Update sieve patch to 0.1.17
 * debian/dovecot-common.postinst: Add warning about expired certificate.
   (Debian Bug: #576455)
 * Silence lintian warnings.

 [Scott Kitterman]
 * Rename dovecot-postfix to mail-stack-delivery per server-maverick-mail-
   integration spec.
   - Update debian/rules
   - Convert existing package to a dummy package and add new binary in debian/control
   - Update maintainer scripts.
   - Move previously installed backups and config files to new package name
     space in preinst
   - Add new debian/mail-stack-delivery.prerm to handle downgrades
   - Rename debian/dovecot-postfix.* to debian/mail-stack-delivery.*

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require "vnd.dovecot.testsuite";
 
2
require "virustest";
 
3
require "relational";
 
4
require "comparator-i;ascii-numeric";
 
5
require "variables";
 
6
 
 
7
/*
 
8
 * Text
 
9
 */
 
10
 
 
11
test_set "message" text:
 
12
From: legitimate@example.com
 
13
To: victim@dovecot.example.net
 
14
Subject: Viral
 
15
X-VirusCheck: Definitely
 
16
X-VirusCheck1: Almost Certain
 
17
X-VirusCheck2: Not sure
 
18
X-VirusCheck3: Presumed Clean
 
19
X-VirusCheck4: Clean
 
20
X-Virus-Scan: Found to be clean.
 
21
X-Virus-Scan1: Found to be infected.
 
22
X-Virus-Scan2: Found to be harmless.
 
23
 
 
24
Test!
 
25
.
 
26
;
 
27
 
 
28
test_config :set "sieve_virustest_status_header" "X-VirusCheck";
 
29
test_config :set "sieve_virustest_status_type" "text";
 
30
test_config :set "sieve_virustest_text_value1" "Clean";
 
31
test_config :set "sieve_virustest_text_value2" "Presumed Clean";
 
32
test_config :set "sieve_virustest_text_value3" "Not sure";
 
33
test_config :set "sieve_virustest_text_value4" "Almost Certain";
 
34
test_config :set "sieve_virustest_text_value5" "Definitely";
 
35
test_config :reload "virustest";
 
36
 
 
37
test "Text: 5" {
 
38
        if virustest :is "0" {
 
39
                test_fail "virustest not configured or test failed";
 
40
        }
 
41
 
 
42
        if not virustest :value "eq" "5" {
 
43
                if virustest :matches "*" { }
 
44
                test_fail "wrong virus value produced: ${1}";
 
45
        }
 
46
}
 
47
 
 
48
test_config :set "sieve_virustest_status_header" "X-VirusCheck1";
 
49
test_config :reload "virustest";
 
50
 
 
51
test "Text: 4" {
 
52
        if virustest :is "0" {
 
53
                test_fail "virustest not configured or test failed";
 
54
        }
 
55
 
 
56
        if not virustest :value "eq" "4" {
 
57
                if virustest :matches "*" { }
 
58
                test_fail "wrong virus value produced: ${1}";
 
59
        }
 
60
}
 
61
 
 
62
test_config :set "sieve_virustest_status_header" "X-VirusCheck2";
 
63
test_config :reload "virustest";
 
64
 
 
65
test "Text: 3" {
 
66
        if virustest :is "0" {
 
67
                test_fail "virustest not configured or test failed";
 
68
        }
 
69
 
 
70
        if not virustest :value "eq" "3" {
 
71
                if virustest :matches "*" { }
 
72
                test_fail "wrong virus value produced: ${1}";
 
73
        }
 
74
}
 
75
 
 
76
test_config :set "sieve_virustest_status_header" "X-VirusCheck3";
 
77
test_config :reload "virustest";
 
78
 
 
79
test "Text: 2" {
 
80
        if virustest :is "0" {
 
81
                test_fail "virustest not configured or test failed";
 
82
        }
 
83
 
 
84
        if not virustest :value "eq" "2" {
 
85
                if virustest :matches "*" { }
 
86
                test_fail "wrong virus value produced: ${1}";
 
87
        }
 
88
}
 
89
 
 
90
test_config :set "sieve_virustest_status_header" "X-VirusCheck4";
 
91
test_config :reload "virustest";
 
92
 
 
93
test "Text: 1" {
 
94
        if virustest :is "0" {
 
95
                test_fail "virustest not configured or test failed";
 
96
        }
 
97
 
 
98
        if not virustest :value "eq" "1" {
 
99
                if virustest :matches "*" { }
 
100
                test_fail "wrong virus value produced: ${1}";
 
101
        }
 
102
}
 
103
 
 
104
test_config :set "sieve_virustest_status_header" "X-Virus-Scan:Found to be (.+)\.";
 
105
test_config :set "sieve_virustest_status_type" "text";
 
106
test_config :set "sieve_virustest_text_value1" "clean";
 
107
test_config :set "sieve_virustest_text_value5" "infected";
 
108
test_config :reload "virustest";
 
109
 
 
110
test "Text: regex: 1" {
 
111
        if virustest :is "0" {
 
112
        test_fail "virustest not configured or test failed";
 
113
    }
 
114
 
 
115
    if not virustest :value "eq" "1" {
 
116
        if virustest :matches "*" { }
 
117
        test_fail "wrong virus value produced: ${1}";
 
118
    }
 
119
}
 
120
 
 
121
test_config :set "sieve_virustest_status_header" "X-Virus-Scan1:Found to be (.+)\.";
 
122
test_config :reload "virustest";
 
123
 
 
124
test "Text: regex: 5" {
 
125
        if virustest :is "0" {
 
126
        test_fail "virustest not configured or test failed";
 
127
    }
 
128
 
 
129
    if not virustest :value "eq" "5" {
 
130
        if virustest :matches "*" { }
 
131
        test_fail "wrong virus value produced: ${1}";
 
132
    }
 
133
}
 
134
 
 
135
test_config :set "sieve_virustest_status_header" "X-Virus-Scan2:Found to be (.+)\.";
 
136
test_config :reload "virustest";
 
137
 
 
138
test "Text: regex: 0" {
 
139
        if not virustest :is "0" {
 
140
        if virustest :matches "*" { }
 
141
        test_fail "wrong virus value produced: ${1}";
 
142
    }
 
143
}