~ubuntu-dev/ubuntu/lucid/dovecot/lucid-201002110912

« back to all changes in this revision

Viewing changes to libsieve/tests/extensions/enotify/mailto.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
require "enotify";
 
3
require "relational";
 
4
require "envelope";
 
5
require "comparator-i;ascii-numeric";
 
6
 
 
7
/*
 
8
 * Simple test
 
9
 */
 
10
 
 
11
test_set "message" text:
 
12
From: stephan@rename-it.nl
 
13
To: nico@vestingbar.nl
 
14
Subject: Frop!
 
15
 
 
16
Klutsefluts.
 
17
.
 
18
;
 
19
 
 
20
test "Simple" {
 
21
        notify "mailto:stephan@rename-it.nl";
 
22
 
 
23
        if not test_result_execute {
 
24
                test_fail "failed to execute notify";
 
25
        }
 
26
 
 
27
        test_message :smtp 0;
 
28
 
 
29
        if not header :matches "Auto-Submitted" "auto-notified*" {
 
30
                test_fail "auto-submitted header set inappropriately";
 
31
        }
 
32
 
 
33
        if not exists "X-Sieve" {
 
34
                test_fail "x-sieve header missing from outgoing message";
 
35
        }
 
36
}
 
37
 
 
38
/*
 
39
 * Multiple recipients
 
40
 */
 
41
 
 
42
test_result_reset;
 
43
 
 
44
test_set "message" text:
 
45
From: stephan@rename-it.nl
 
46
To: nico@vestingbar.nl
 
47
Subject: Frop!
 
48
 
 
49
Klutsefluts.
 
50
.
 
51
;
 
52
 
 
53
test "Multiple recipients" {
 
54
        notify "mailto:timo@example.com%2cstephan@dovecot.org?cc=postmaster@vestingbar.nl&subject=Frop%20received";
 
55
 
 
56
        if not test_result_execute {
 
57
                test_fail "failed to execute notify";
 
58
        }
 
59
 
 
60
        test_message :smtp 0;
 
61
 
 
62
        if not address :is "to" "timo@example.com" {
 
63
                test_fail "first To address missing";
 
64
        }
 
65
 
 
66
        if not address :is "to" "stephan@dovecot.org" {
 
67
                test_fail "second To address missing";
 
68
        }
 
69
 
 
70
        if not address :is "cc" "postmaster@vestingbar.nl" {
 
71
                test_fail "first Cc address missing";
 
72
        }
 
73
 
 
74
        if not address :count "eq" :comparator "i;ascii-numeric" "to" "2" {
 
75
                test_fail "too many recipients in To header";
 
76
        } 
 
77
 
 
78
        if not address :count "eq" :comparator "i;ascii-numeric" "cc" "1" {
 
79
                test_fail "too many recipients in Cc header";
 
80
        } 
 
81
 
 
82
        if not header "subject" "Frop received" {
 
83
                test_fail "subject header set incorrectly";
 
84
        }
 
85
 
 
86
        test_message :smtp 1;
 
87
 
 
88
        if not header :matches "Auto-Submitted" "auto-notified*" {
 
89
                test_fail "auto-submitted header not found for second message";
 
90
        }
 
91
 
 
92
        test_message :smtp 2;
 
93
 
 
94
        if not header :matches "Auto-Submitted" "auto-notified*" {
 
95
                test_fail "auto-submitted header not found for third message";
 
96
        }
 
97
}
 
98
 
 
99
/*
 
100
 * Duplicate recipients
 
101
 */
 
102
 
 
103
test_result_reset;
 
104
 
 
105
test_set "message" text:
 
106
From: stephan@rename-it.nl
 
107
To: nico@vestingbar.nl
 
108
Subject: Frop!
 
109
 
 
110
Klutsefluts.
 
111
.
 
112
;
 
113
 
 
114
test "Duplicate recipients" {
 
115
        notify "mailto:timo@example.com%2cstephan@dovecot.org?cc=stephan@dovecot.org";
 
116
        notify "mailto:stephan@rename-it.nl?cc=timo@example.com";
 
117
 
 
118
        if not test_result_execute {
 
119
                test_fail "failed to execute notify";
 
120
        }
 
121
 
 
122
        test_message :smtp 0;
 
123
 
 
124
        if address "Cc" "stephan@dovecot.org" {
 
125
                test_fail "duplicate recipient not removed from first message";
 
126
        }
 
127
 
 
128
        test_message :smtp 1;
 
129
 
 
130
        if address "Cc" "timo@example.com" {
 
131
                test_fail "duplicate recipient not removed from second message";
 
132
        }
 
133
}
 
134
 
 
135
 
 
136
/*
 
137
 * Notifying on automated messages
 
138
 */
 
139
 
 
140
test_result_reset;
 
141
 
 
142
test_set "message" text:
 
143
From: stephan@rename-it.nl
 
144
To: nico@vestingbar.nl
 
145
Auto-submitted: auto-notify
 
146
Subject: Frop!
 
147
 
 
148
Klutsefluts.
 
149
.
 
150
;
 
151
 
 
152
test "Notifying on automated messages" {
 
153
        notify "mailto:stephan@rename-it.nl?cc=timo@example.com";
 
154
 
 
155
        if not test_result_execute {
 
156
                test_fail "failed to execute notify";
 
157
        }
 
158
 
 
159
        if test_message :smtp 0 {
 
160
                test_fail "notified of auto-submitted message";
 
161
        }
 
162
}
 
163
 
 
164
/*
 
165
 * Envelope
 
166
 */
 
167
 
 
168
test_set "message" text:
 
169
From: stephan@rename-it.nl
 
170
To: nico@vestingbar.nl
 
171
Subject: Frop!
 
172
 
 
173
Klutsefluts.
 
174
.
 
175
;
 
176
 
 
177
test_result_reset;
 
178
 
 
179
test_set "envelope.from" "sirius@rename-it.nl";
 
180
test_set "envelope.to" "bertus@vestingbar.nl";
 
181
 
 
182
test "Envelope" {
 
183
        notify "mailto:stephan@rename-it.nl?cc=timo@example.com";
 
184
 
 
185
        if not test_result_execute {
 
186
                test_fail "failed to execute notify";
 
187
        }
 
188
 
 
189
        test_message :smtp 0;
 
190
 
 
191
        if not envelope :localpart :is "from" "postmaster" {
 
192
                test_fail "envelope sender set incorrectly";
 
193
        }
 
194
 
 
195
        if not envelope :is "to" "stephan@rename-it.nl" {
 
196
                test_fail "envelope sender set incorrectly";
 
197
        }
 
198
 
 
199
        test_message :smtp 1;
 
200
 
 
201
        if not envelope :localpart :is "from" "postmaster" {
 
202
                test_fail "envelope sender set incorrectly";
 
203
        }
 
204
 
 
205
        if not envelope :is "to" "timo@example.com" {
 
206
                test_fail "envelope sender set incorrectly";
 
207
        }       
 
208
}
 
209
 
 
210
/* 
 
211
 * Envelope :from 
 
212
 */
 
213
 
 
214
test_set "message" text:
 
215
From: stephan@rename-it.nl
 
216
To: nico@vestingbar.nl
 
217
Subject: Frop!
 
218
 
 
219
Klutsefluts.
 
220
.
 
221
;
 
222
 
 
223
test_set "envelope.from" "sirius@rename-it.nl";
 
224
test_set "envelope.to" "bertus@vestingbar.nl";
 
225
 
 
226
test_result_reset;
 
227
 
 
228
test "Envelope :from" {
 
229
        notify :from "nico@vestingbar.nl"
 
230
                "mailto:stephan@rename-it.nl?cc=timo@example.com";
 
231
 
 
232
        if not test_result_execute {
 
233
                test_fail "failed to execute notify";
 
234
        }
 
235
 
 
236
        test_message :smtp 0;
 
237
 
 
238
        if not envelope :is "from" "nico@vestingbar.nl" {
 
239
                test_fail "envelope sender set incorrectly";
 
240
        }
 
241
 
 
242
        if not envelope :is "to" "stephan@rename-it.nl" {
 
243
                test_fail "envelope sender set incorrectly";
 
244
        }
 
245
 
 
246
        test_message :smtp 1;
 
247
 
 
248
        if not envelope :is "from" "nico@vestingbar.nl" {
 
249
                test_fail "envelope sender set incorrectly";
 
250
        }
 
251
 
 
252
        if not envelope :is "to" "timo@example.com" {
 
253
                test_fail "envelope sender set incorrectly";
 
254
        }       
 
255
}
 
256
 
 
257
/* 
 
258
 * Envelope <> 
 
259
 */
 
260
 
 
261
test_set "message" text:
 
262
From: stephan@rename-it.nl
 
263
To: nico@vestingbar.nl
 
264
Subject: Frop!
 
265
 
 
266
Klutsefluts.
 
267
.
 
268
;
 
269
 
 
270
test_set "envelope.from" "<>";
 
271
test_set "envelope.to" "bertus@vestingbar.nl";
 
272
 
 
273
test_result_reset;
 
274
 
 
275
test "Envelope <>" {
 
276
        notify :from "nico@vestingbar.nl"
 
277
                "mailto:stephan@rename-it.nl?cc=timo@example.com";
 
278
 
 
279
        if not test_result_execute {
 
280
                test_fail "failed to execute notify";
 
281
        }
 
282
 
 
283
        test_message :smtp 0;
 
284
 
 
285
        if not envelope :is "from" "" {
 
286
                test_fail "envelope sender set incorrectly";
 
287
        }
 
288
 
 
289
        if not envelope :is "to" "stephan@rename-it.nl" {
 
290
                test_fail "envelope sender set incorrectly";
 
291
        }
 
292
 
 
293
        test_message :smtp 1;
 
294
 
 
295
        if not envelope :is "from" "" {
 
296
                test_fail "envelope sender set incorrectly";
 
297
        }
 
298
 
 
299
        if not envelope :is "to" "timo@example.com" {
 
300
                test_fail "envelope sender set incorrectly";
 
301
        }       
 
302
}