~ubuntu-dev/ubuntu/lucid/dovecot/lucid-201002101901

« back to all changes in this revision

Viewing changes to libsieve/tests/extensions/relational/basic.svtest

  • Committer: Chuck Short
  • Date: 2010-01-21 20:21:25 UTC
  • mfrom: (4.1.11 squeeze)
  • Revision ID: zulcss@ubuntu.com-20100121202125-pme73o491kfwj5nc
* Merge from debian testing, remaining changes:
  + Add new binary pkg dovecot-postfix that integrates postfix and dovecot
    automatically: (LP: #164837)
  + debian/control:
    - add new binary with short description
    - set Architecture all for dovecot-postfix (LP: #329878)
  + debian/dovecot-postfix.postinst:
    - create initial certificate symlinks to snakeoil.
    - set up postfix with postconf to:
      - use Maildir/ as the default mailbox.
      - use dovecot as the sasl authentication server.
      - use dovecot LDA (deliver).
      - use tls for smtp{d} services.
    - fix certificates paths in postfix' main.cf
    - add reject_unauth_destination to postfix' recipient restrictions
    - add reject_unknown_sender_domain to postfix' sender restriction
    - rename configuration name on remove, delete on purge
    - restart dovecot after linking certificates
    - handle use case when postfix is unconfigurated
  + debian/dovecot-postfix.dirs: create backup directory for postfix's config
    configuration
  + restart postfix and dovecot.
  + debian/dovecot-postfix.postrm:
    - remove all dovecot related configuration from postfix.
    - restart postfix and dovecot.
  + debian/dovecot-common.init:
    - check if /etc/dovecot/dovecot-postfix.conf exists and use it
      as the configuration file if so.
  + debian/patches/warning-ubuntu-postfix.dpatch
    - add warning about dovecot-postfix.conf in dovecot default
      configuration file
  + debian/patches/dovecot-postfix.conf.diff:
    - Ubuntu server custom changes to the default dovecot configuration for
      better interfation with postfix.
    - enable sieve plugin.
    - Ubuntu server custom changes to the default dovecot configuration for
      better integration with postfix:
      - enable imap, pop3, imaps, pop3s and managesieve by default.
      - enable dovecot LDA (deliver).
      - enable SASL auth socket in postfix private directory
   + debian/rules:
     - copy, patch and install dovecot-postfix.conf in /etc/dovecot/.
     - build architecure independent packages too
   + Use Snakeoil SSL certificates by default.
     - debian/control: Depend on ssl-cert.
     - debian/patches/ssl-cert-snakeoil.dpatch: Change default SSL cert
       paths to snakeoil.
     - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
   + Add autopkgtest to debian/tests/*.
   + Fast TearDown: Update the lsb init header to not stop in level 6.
   + Add ufw integration:
     - Created debian/dovecot-common.ufw.profile.
     - debian/rules: install profile.
     - debian/control: suggest ufw.
   + debian/{control,rules}: enable PIE hardening.
   + dovecot-imapd, dovecot-pop3: Replaces dovecot-common (<< 1:1.1). (LP: #254721)
   + debian/control: Update Vcs-* headers.
   + Add SMTP-AUTH support for Outlook (login auth mechanism)
* New upstream release.
* debian/patches/gold-fix.patch: Removed. Fixed upstream.
* Moved libexec to lib corrections in dovecot-managesieve.patch and
  dovecot-managesieve-dist.patch to dovecot-example.patch
* debian/patches/dovecot-mboxlocking.patch: Regenerated to avoid FTBFS
  when quilt isn't installed.
* debian/patches/quota-mountpoint.patch: Removed. Not needed anymore.
* debian/patches/dovecot-quota.patch: Removed. Quotas aren't properly
  enabled unless mail_plugins = quota imap_quota.
* debian/patches/gold-fix.patch: Fixed configure script to build even
  with binutils-gold or --no-add-needed linker flag (Closes: #554306)
* debian/dovecot-common.init: fixed LSB headers. Thanks to Pascal Volk.
  (Closes: #558040)
* debian/changelog: added CVE references to previous changelog entry.
* debian/rules: checked up the build system. It's not fragile anymore.
  (Closes: 493803)
* debian/dovecot-common.postinst: Now invoking dpkg-reconfigure
  on dovecot-common is enough to generate new certificates
  if the previous ones were removed. (Closes: #545582)
* debian/rules: No longer install convert-tool in /usr/bin.
  It isn't an user utility and it should stay in /usr/lib/dovecot
  like all other similar tool.
* New upstream release. (Closes: #557601)
* [SECURITY] Fixes local information disclosure and denial of service.
  (see: http://www.dovecot.org/list/dovecot-news/2009-November/000143.html
  and CVE-2009-3897)
* Added myself to uploaders.
* Switched to the new source format "3.0 (quilt)":
  - removed dpatch from build-depends
  - removed debian/README.source because now we use only standard
    dpkg features
  - regenerated all patches
* Prepared to switch to multi-origin source:
  - recreated dovecot-libsieve.patch and dovecot-managesieve-dist.patch
    starting from the upstream tarball
  - removed all autotools related build-depends and build-conflict
  - renamed dovecot-libsieve and dovecot-managesieve directories
    to libsieve and managesieve.
* debian/rules: Moved the configuration of libsieve and managesieve from
  the build phase to the configuration phase
* Added dovecot-dbg package  with debugging symbols.  Thanks Stephan Bosch.
  (Closes: #554710)
* Fixed some stray libexec'isms in the default configuration.
* New upstream release.
* debian/dovecot-common.init:
  - use $CONF when starting the daemon. (Closes: #549944)
  - always output start/stop messages. (Closes: #523810)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require "vnd.dovecot.testsuite";
 
2
 
 
3
require "relational";
 
4
require "comparator-i;ascii-numeric";
 
5
 
 
6
/* 
 
7
 * Test message
 
8
 */
 
9
 
 
10
test_set "message" text:
 
11
From: stephan@rename-it.nl
 
12
To: nico@vestingbar.nl
 
13
Cc: frop@rename-it.nl
 
14
CC: timo@rename-it.nl
 
15
X-Spam-Score: 300
 
16
X-Nonsense: 1000
 
17
X-Nonsense: 20
 
18
X-Alpha: abcdzyx
 
19
X-Count: a
 
20
X-Count: b
 
21
X-Count: c
 
22
X-Count: d
 
23
X-Count: e
 
24
X-Count: f
 
25
X-Count: g
 
26
X-Count: h
 
27
X-Count: i
 
28
X-Count: j
 
29
X-Count: k
 
30
X-Count: l
 
31
X-Count: m
 
32
X-Count: n
 
33
X-Count: o
 
34
X-Count: p
 
35
X-Count: q
 
36
X-Count: r
 
37
X-Count: s
 
38
X-Count: t
 
39
X-Count: u
 
40
X-Count: v
 
41
X-Count: w
 
42
X-Count: x
 
43
X-Count: y
 
44
X-Count: z
 
45
Subject: Test
 
46
Comment:                                    
 
47
 
 
48
Test!
 
49
.
 
50
;
 
51
 
 
52
/*
 
53
 * Empty strings
 
54
 */
 
55
 
 
56
test "Value \"\" eq 40 (vs)" {
 
57
        if header :value "eq" :comparator "i;ascii-numeric" "comment" "40" {
 
58
                test_fail ":value matched empty string with i;ascii-numeric";
 
59
        }
 
60
 
 
61
        if header :value "gt" :comparator "i;ascii-numeric" "x-spam-score" "" {
 
62
                test_fail ":value 300 exceeded empty string with i;ascii-numeric";
 
63
        }
 
64
 
 
65
        if header :value "gt" :comparator "i;ascii-numeric" "x-spam-score" "" {
 
66
        test_fail ":count exceeded empty string with i;ascii-numeric";
 
67
    }
 
68
}
 
69
 
 
70
/* 
 
71
 * Match type :value
 
72
 */
 
73
 
 
74
test "Value 300 eq 2" {
 
75
        if header :value "eq" :comparator "i;ascii-numeric" "x-spam-score" "2" {
 
76
                test_fail "should not have matched";
 
77
        } 
 
78
}
 
79
 
 
80
test "Value 300 lt 2" {
 
81
        if header :value "lt" :comparator "i;ascii-numeric" "x-spam-score" "2" {
 
82
                test_fail "should not have matched";
 
83
        }
 
84
}
 
85
 
 
86
test "Value 300 le 300" {
 
87
        if not header :value "le" :comparator "i;ascii-numeric" "x-spam-score" "300" {
 
88
                test_fail "should have matched";
 
89
        }
 
90
}
 
91
 
 
92
test "Value 300 le 302" {
 
93
        if not header :value "le" :comparator "i;ascii-numeric" "x-spam-score" "302" {
 
94
                test_fail "should have matched";
 
95
        }
 
96
}
 
97
 
 
98
test "Value 302 le 00302" {
 
99
        if not header :value "le" :comparator "i;ascii-numeric" "x-spam-score" "00302" {
 
100
                test_fail "should have matched";
 
101
    }
 
102
}
 
103
 
 
104
test "Value {1000,20} le 300" {
 
105
    if not header :value "le" :comparator "i;ascii-numeric" "x-nonsense" "300" {
 
106
        test_fail "should have matched";
 
107
    }
 
108
}
 
109
 
 
110
test "Value {1000,20} lt 3" {
 
111
    if header :value "lt" :comparator "i;ascii-numeric" "x-nonsense" "3" {
 
112
        test_fail "should not have matched";
 
113
    }
 
114
}
 
115
 
 
116
test "Value {1000,20} gt 3000" {
 
117
    if header :value "gt" :comparator "i;ascii-numeric" "x-nonsense" "3000" {
 
118
        test_fail "should not have matched";
 
119
    }
 
120
}
 
121
 
 
122
test "Value {1000,20} gt {3000,30}" {
 
123
    if not header :value "gt" :comparator "i;ascii-numeric" "x-nonsense" ["3000","30"] {
 
124
        test_fail "should have matched";
 
125
    }
 
126
}
 
127
 
 
128
test "Value {1000,20} lt {3, 19})" {
 
129
    if header :value "lt" :comparator "i;ascii-numeric" "x-nonsense" ["3","19"] {
 
130
        test_fail "should not have matched";
 
131
    }
 
132
}
 
133
 
 
134
test "Value {1000,20} gt {3000,1001}" {
 
135
    if header :value "gt" :comparator "i;ascii-numeric" "x-nonsense" ["3000","1001"] {
 
136
        test_fail "should not have matched";
 
137
    }
 
138
}
 
139
 
 
140
test "Value abcdzyz gt aaaaaaa" {
 
141
    if not header :value "gt" :comparator "i;octet" "x-alpha" "aaaaaaa" {
 
142
        test_fail "should have matched";
 
143
    }
 
144
}
 
145
 
 
146
/* 
 
147
 * Match type :count
 
148
 */
 
149
 
 
150
test "Count 2 ne 2" {
 
151
        if header :count "ne" :comparator "i;ascii-numeric" "cc" "2" {
 
152
                test_fail "should not have matched";
 
153
        }
 
154
}
 
155
 
 
156
test "Count 2 ge 2" {
 
157
        if not header :count "ge" :comparator "i;ascii-numeric" "cc" "2" {
 
158
                test_fail "should have matched";
 
159
        }
 
160
}
 
161
 
 
162
test "Count 2 ge 002" {
 
163
        if not header :count "ge" :comparator "i;ascii-numeric" "cc" "002" {
 
164
                test_fail "should have matched";
 
165
        }
 
166
}
 
167
 
 
168
test "Count 26 lt {4,5,6,10,20}" {
 
169
        if header :count "lt" :comparator "i;ascii-numeric" "x-count" ["4","5","6","10","20"] {
 
170
                test_fail "should not have matched";
 
171
        }
 
172
}
 
173
 
 
174
test "Count 26 lt {4,5,6,10,20,100}" {
 
175
        if not header :count "lt" :comparator "i;ascii-numeric" "x-count" ["4","5","6","10","20","100"] {
 
176
                test_fail "should have matched";
 
177
        }
 
178
}