Commit | Line | Data |
---|---|---|
59371ea7 PH |
1 | # Sieve tests using -bf |
2 | rmfiltertest | |
3 | catwrite test-data | |
4 | # Sieve filter | |
5 | if address ["From","To"] "marian@abcdefgh.example" | |
6 | { discard; } | |
7 | **** | |
8 | exim -bf test-data <aux-fixed/TESTNUM.message | |
9 | **** | |
10 | catwrite test-data | |
11 | # Sieve filter | |
12 | if address :is "From" "marian@abcdefgh.example" | |
13 | { discard; } | |
14 | **** | |
15 | exim -bf test-data <aux-fixed/TESTNUM.message | |
16 | **** | |
17 | catwrite test-data | |
18 | # Sieve filter | |
19 | if address :is "To" "marian@abcdefgh.example" | |
20 | { discard; } | |
21 | **** | |
22 | exim -bf test-data <aux-fixed/TESTNUM.message | |
23 | **** | |
24 | catwrite test-data | |
25 | # Sieve filter | |
26 | if address :contains "To" "abcdefgh" | |
27 | { discard; } | |
28 | **** | |
29 | exim -bf test-data <aux-fixed/TESTNUM.message | |
30 | **** | |
31 | catwrite test-data | |
32 | # Sieve filter | |
33 | if address :matches "To" "*abc?efgh*" | |
34 | { discard; } | |
35 | **** | |
36 | exim -bf test-data <aux-fixed/TESTNUM.message | |
37 | **** | |
38 | catwrite test-data | |
39 | # Sieve filter | |
40 | if true { discard; } | |
41 | **** | |
42 | exim -bf test-data <aux-fixed/TESTNUM.message | |
43 | **** | |
44 | catwrite test-data | |
45 | # Sieve filter | |
46 | if false { discard; } | |
47 | **** | |
48 | exim -bf test-data <aux-fixed/TESTNUM.message | |
49 | **** | |
50 | catwrite test-data | |
51 | # Sieve filter | |
52 | if allof (false,false) { discard; } | |
53 | **** | |
54 | exim -bf test-data <aux-fixed/TESTNUM.message | |
55 | **** | |
56 | catwrite test-data | |
57 | # Sieve filter | |
58 | if allof (true,false) { discard; } | |
59 | **** | |
60 | exim -bf test-data <aux-fixed/TESTNUM.message | |
61 | **** | |
62 | catwrite test-data | |
63 | # Sieve filter | |
64 | if allof (false,true) { discard; } | |
65 | **** | |
66 | exim -bf test-data <aux-fixed/TESTNUM.message | |
67 | **** | |
68 | catwrite test-data | |
69 | # Sieve filter | |
70 | if allof (true,true) { discard; } | |
71 | **** | |
72 | exim -bf test-data <aux-fixed/TESTNUM.message | |
73 | **** | |
74 | catwrite test-data | |
75 | # Sieve filter | |
76 | if anyof (false,false) { discard; } | |
77 | **** | |
78 | exim -bf test-data <aux-fixed/TESTNUM.message | |
79 | **** | |
80 | catwrite test-data | |
81 | # Sieve filter | |
82 | if anyof (true,false) { discard; } | |
83 | **** | |
84 | exim -bf test-data <aux-fixed/TESTNUM.message | |
85 | **** | |
86 | catwrite test-data | |
87 | # Sieve filter | |
88 | if anyof (false,true) { discard; } | |
89 | **** | |
90 | exim -bf test-data <aux-fixed/TESTNUM.message | |
91 | **** | |
92 | catwrite test-data | |
93 | # Sieve filter | |
94 | if anyof (true,true) { discard; } | |
95 | **** | |
96 | exim -bf test-data <aux-fixed/TESTNUM.message | |
97 | **** | |
98 | catwrite test-data | |
99 | # Sieve filter | |
100 | if not anyof (false,false) { discard; } | |
101 | **** | |
102 | exim -bf test-data <aux-fixed/TESTNUM.message | |
103 | **** | |
104 | catwrite test-data | |
105 | # Sieve filter | |
106 | if not anyof (true,false) { discard; } | |
107 | **** | |
108 | exim -bf test-data <aux-fixed/TESTNUM.message | |
109 | **** | |
110 | catwrite test-data | |
111 | # Sieve filter | |
112 | if not anyof (false,true) { discard; } | |
113 | **** | |
114 | exim -bf test-data <aux-fixed/TESTNUM.message | |
115 | **** | |
116 | catwrite test-data | |
117 | # Sieve filter | |
118 | if not anyof (true,true) { discard; } | |
119 | **** | |
120 | exim -bf test-data <aux-fixed/TESTNUM.message | |
121 | **** | |
122 | catwrite test-data | |
123 | # Sieve filter | |
124 | if header "to" "MARIAN@abcdefgh.example" { discard; } | |
125 | **** | |
126 | exim -bf test-data <aux-fixed/TESTNUM.message | |
127 | **** | |
128 | catwrite test-data | |
129 | # Sieve filter | |
130 | if header :comparator "i;octet" "to" "MARIAN@abcdefgh.example" { discard; } | |
131 | **** | |
132 | exim -bf test-data <aux-fixed/TESTNUM.message | |
133 | **** | |
134 | catwrite test-data | |
135 | # Sieve filter | |
136 | if header :comparator "i;ascii-casemap" "to" "MARIAN@abcdefgh.example" { discard; } | |
137 | **** | |
138 | exim -bf test-data <aux-fixed/TESTNUM.message | |
139 | **** | |
140 | catwrite test-data | |
141 | # Sieve filter | |
142 | require "envelope"; | |
143 | if envelope "from" "marian@somenet.example" { discard; } | |
144 | **** | |
145 | exim -bf test-data <aux-fixed/TESTNUM.message | |
146 | **** | |
147 | catwrite test-data | |
148 | # Sieve filter | |
149 | require "envelope"; | |
150 | if envelope "from" "offerqn@bpk.example.com" { discard; } | |
151 | **** | |
152 | exim -bf test-data <aux-fixed/TESTNUM.message | |
153 | **** | |
154 | catwrite test-data | |
155 | # Sieve filter | |
156 | if exists [ "X-NotHere", "X-Notheretoo" ] { discard; } | |
157 | **** | |
158 | exim -bf test-data <aux-fixed/TESTNUM.message | |
159 | **** | |
160 | catwrite test-data | |
161 | # Sieve filter | |
162 | if exists [ "X-NotHere", "Delivered-To" ] { discard; } | |
163 | **** | |
164 | exim -bf test-data <aux-fixed/TESTNUM.message | |
165 | **** | |
166 | catwrite test-data | |
167 | # Sieve filter | |
168 | if exists [ "From", "Delivered-To" ] { discard; } | |
169 | **** | |
170 | exim -bf test-data <aux-fixed/TESTNUM.message | |
171 | **** | |
172 | catwrite test-data | |
173 | # Sieve filter | |
174 | if header :contains "X-NotHere" "" { discard; } | |
175 | **** | |
176 | exim -bf test-data <aux-fixed/TESTNUM.message | |
177 | **** | |
178 | catwrite test-data | |
179 | # Sieve filter | |
180 | if header "Delivered-To" "" { discard; } | |
181 | **** | |
182 | exim -bf test-data <aux-fixed/TESTNUM.message | |
183 | **** | |
184 | catwrite test-data | |
185 | # Sieve filter | |
186 | if header :contains "Delivered-To" "" { discard; } | |
187 | **** | |
188 | exim -bf test-data <aux-fixed/TESTNUM.message | |
189 | **** | |
190 | catwrite test-data | |
191 | # Sieve filter | |
192 | if header :contains "Delivered-To" "rc@irc.somenet.example" { discard; } | |
193 | **** | |
194 | exim -bf test-data <aux-fixed/TESTNUM.message | |
195 | **** | |
196 | catwrite test-data | |
197 | # Sieve filter | |
198 | if header "Delivered-To" ["irc@irc.somenet.example"] { discard; } | |
199 | **** | |
200 | exim -bf test-data <aux-fixed/TESTNUM.message | |
201 | **** | |
202 | catwrite test-data | |
203 | # Sieve filter | |
204 | if header "Delivered-To" ["irc@irc.somenet.example","irc@01019somenet.example","some.one"] { discard; } | |
205 | **** | |
206 | exim -bf test-data <aux-fixed/TESTNUM.message | |
207 | **** | |
208 | catwrite test-data | |
209 | # Sieve filter | |
210 | if header "Mime-Version" "1.0" { discard; } | |
211 | **** | |
212 | exim -bf test-data <aux-fixed/TESTNUM.message | |
213 | **** | |
214 | catwrite test-data | |
215 | # Sieve filter | |
216 | if false { discard; } | |
217 | **** | |
218 | exim -bf test-data <aux-fixed/TESTNUM.message | |
219 | **** | |
220 | catwrite test-data | |
221 | # Sieve filter | |
222 | if true { discard; } | |
223 | **** | |
224 | exim -bf test-data <aux-fixed/TESTNUM.message | |
225 | **** | |
226 | catwrite test-data | |
227 | # Sieve filter | |
228 | if true { discard; } else { keep; } | |
229 | **** | |
230 | exim -bf test-data <aux-fixed/TESTNUM.message | |
231 | **** | |
232 | catwrite test-data | |
233 | # Sieve filter | |
234 | if false { keep; } else { discard; } | |
235 | **** | |
236 | exim -bf test-data <aux-fixed/TESTNUM.message | |
237 | **** | |
238 | catwrite test-data | |
239 | # Sieve filter | |
240 | if false { keep; } elsif true { discard; } else { keep; } | |
241 | **** | |
242 | exim -bf test-data <aux-fixed/TESTNUM.message | |
243 | **** | |
244 | catwrite test-data | |
245 | # Sieve filter | |
246 | if true { discard; } elsif true { keep; } else { keep; } | |
247 | **** | |
248 | exim -bf test-data <aux-fixed/TESTNUM.message | |
249 | **** | |
250 | catwrite test-data | |
251 | # Sieve filter | |
252 | if false { keep; } | |
253 | else | |
254 | { if true { discard; } else { keep; } } | |
255 | **** | |
256 | exim -bf test-data <aux-fixed/TESTNUM.message | |
257 | **** | |
258 | catwrite test-data | |
259 | # Sieve filter | |
260 | if header :matches "to" "MA*AN@abc*fg?.example" { discard; } | |
261 | **** | |
262 | exim -bf test-data <aux-fixed/TESTNUM.message | |
263 | **** | |
264 | catwrite test-data | |
265 | # Sieve filter | |
266 | if not header :matches "to" "MA?AN@abc*fg?.example" { discard; } | |
267 | **** | |
268 | exim -bf test-data <aux-fixed/TESTNUM.message | |
269 | **** | |
270 | catwrite test-data | |
271 | # Sieve filter | |
272 | if header :matches "to" "*marian@abcdefgh.example" { discard; } | |
273 | **** | |
274 | exim -bf test-data <aux-fixed/TESTNUM.message | |
275 | **** | |
276 | catwrite test-data | |
277 | # Sieve filter | |
278 | if not header :matches "to" "?marian@abcdefgh.example" { discard; } | |
279 | **** | |
280 | exim -bf test-data <aux-fixed/TESTNUM.message | |
281 | **** | |
282 | catwrite test-data | |
283 | # Sieve filter | |
284 | if header :matches "to" "marian@abcdefgh.example*" { discard; } | |
285 | **** | |
286 | exim -bf test-data <aux-fixed/TESTNUM.message | |
287 | **** | |
288 | catwrite test-data | |
289 | # Sieve filter | |
290 | if not header :matches "to" "marian@abcdefgh.example?" { discard; } | |
291 | **** | |
292 | exim -bf test-data <aux-fixed/TESTNUM.message | |
293 | **** | |
294 | catwrite test-data | |
295 | # Sieve filter | |
296 | if header :matches "x-special1" "\\?*\\*" { discard; } | |
297 | **** | |
298 | exim -bf test-data <aux-fixed/TESTNUM.message | |
299 | **** | |
300 | catwrite test-data | |
301 | # Sieve filter | |
302 | if header :matches "x-special1" "*\0*" { discard; } | |
303 | **** | |
304 | exim -bf test-data <aux-fixed/TESTNUM.message | |
305 | **** | |
306 | catwrite test-data | |
307 | # Sieve filter | |
308 | if not header :matches "x-special1" "*\0*q" { discard; } | |
309 | **** | |
310 | exim -bf test-data <aux-fixed/TESTNUM.message | |
311 | **** | |
312 | catwrite test-data | |
313 | # Sieve filter | |
314 | if not header :matches "x-special2" "\\?*\\*" { discard; } | |
315 | **** | |
316 | exim -bf test-data <aux-fixed/TESTNUM.message | |
317 | **** | |
318 | catwrite test-data | |
319 | # Sieve filter | |
320 | if not header :matches "x-special2" "*\0*" { discard; } | |
321 | **** | |
322 | exim -bf test-data <aux-fixed/TESTNUM.message | |
323 | **** | |
324 | catwrite test-data | |
325 | # Sieve filter | |
326 | if size :over 400 { | |
327 | discard; | |
328 | } | |
329 | **** | |
330 | exim -bf test-data <aux-fixed/TESTNUM.message | |
331 | **** | |
332 | catwrite test-data | |
333 | # Sieve filter | |
334 | if size :over 4K { | |
335 | discard; | |
336 | } | |
337 | **** | |
338 | exim -bf test-data <aux-fixed/TESTNUM.message | |
339 | **** | |
340 | catwrite test-data | |
341 | # Sieve filter | |
342 | if size :under 4K { discard; } | |
343 | **** | |
344 | exim -bf test-data <aux-fixed/TESTNUM.message | |
345 | **** | |
346 | catwrite test-data | |
347 | # Sieve filter | |
348 | if size :under 400 { discard; } | |
349 | **** | |
350 | exim -bf test-data <aux-fixed/TESTNUM.message | |
351 | **** | |
352 | catwrite test-data | |
353 | # Sieve filter | |
354 | if false { keep; } | |
355 | **** | |
356 | exim -bf test-data <aux-fixed/TESTNUM.message | |
357 | **** | |
358 | # Syntax checks | |
359 | catwrite test-data | |
360 | # no filter line here | |
361 | if unknowntest { keep; } | |
362 | **** | |
363 | 1 | |
364 | exim -bf test-data <aux-fixed/TESTNUM.message | |
365 | **** | |
366 | catwrite test-data | |
367 | # Sieve filter | |
368 | if test keep; } | |
369 | **** | |
370 | exim -bf test-data <aux-fixed/TESTNUM.message | |
371 | **** | |
372 | catwrite test-data | |
373 | # Sieve filter | |
374 | if test { keep; | |
375 | **** | |
376 | exim -bf test-data <aux-fixed/TESTNUM.message | |
377 | **** | |
378 | catwrite test-data | |
379 | # Sieve filter | |
380 | if true { unknownaction; } | |
381 | **** | |
382 | exim -bf test-data <aux-fixed/TESTNUM.message | |
383 | **** | |
384 | catwrite test-data | |
385 | # Sieve filter | |
386 | if true { fileinto abcdefgh; } | |
387 | **** | |
388 | exim -bf test-data <aux-fixed/TESTNUM.message | |
389 | **** | |
390 | catwrite test-data | |
391 | # Sieve filter | |
392 | require "fileinto"; | |
393 | if true { fileinto "abcdefgh"; } | |
394 | **** | |
395 | exim -bf test-data <aux-fixed/TESTNUM.message | |
396 | **** | |
397 | catwrite test-data | |
398 | # Sieve filter | |
399 | if header ["to"] [ "marian@abcdefgh.example", "achnee"] { discard; } | |
400 | **** | |
401 | exim -bf test-data <aux-fixed/TESTNUM.message | |
402 | **** | |
403 | catwrite test-data | |
404 | # Sieve filter | |
405 | if header "to" [ "egal", "achnee" { keep; } | |
406 | **** | |
407 | exim -bf test-data <aux-fixed/TESTNUM.message | |
408 | **** | |
409 | catwrite test-data | |
410 | # Sieve filter | |
411 | if header "to","from"] "egal" { keep; } | |
412 | **** | |
413 | exim -bf test-data <aux-fixed/TESTNUM.message | |
414 | **** | |
415 | catwrite test-data | |
416 | # Sieve filter | |
417 | if header ["to","from" "egal" { keep; } | |
418 | **** | |
419 | exim -bf test-data <aux-fixed/TESTNUM.message | |
420 | **** | |
421 | catwrite test-data | |
422 | # Sieve filter | |
423 | if header ["to",,"from"] "egal" { keep; } | |
424 | **** | |
425 | exim -bf test-data <aux-fixed/TESTNUM.message | |
426 | **** | |
427 | catwrite test-data | |
428 | # Sieve filter | |
429 | if header ["to",] "egal" { keep; } | |
430 | **** | |
431 | exim -bf test-data <aux-fixed/TESTNUM.message | |
432 | **** | |
433 | catwrite test-data | |
434 | # Sieve filter | |
435 | if header [,"to"] "egal" { keep; } | |
436 | **** | |
437 | exim -bf test-data <aux-fixed/TESTNUM.message | |
438 | **** | |
439 | catwrite test-data | |
440 | # Sieve filter | |
441 | if unknowntest { keep; } | |
442 | **** | |
443 | exim -bf test-data <aux-fixed/TESTNUM.message | |
444 | **** | |
445 | catwrite test-data | |
446 | # Sieve filter | |
447 | if header :matches "to" "egal" { keep; } | |
448 | **** | |
449 | exim -bf test-data <aux-fixed/TESTNUM.message | |
450 | **** | |
451 | catwrite test-data | |
452 | # Sieve filter | |
453 | if header :unknown "to" "egal" { keep; } | |
454 | **** | |
455 | exim -bf test-data <aux-fixed/TESTNUM.message | |
456 | **** | |
457 | catwrite test-data | |
458 | # Sieve filter | |
459 | # | |
460 | require ["fileinto", "envelope"]; | |
461 | ||
462 | if header :matches "X-Warning" "* is listed at list.dsbl.org*" | |
463 | { | |
464 | keep; # keep in "In" folder | |
465 | } | |
466 | **** | |
467 | exim -bf test-data <aux-fixed/TESTNUM.message2 | |
468 | **** | |
469 | catwrite test-data | |
470 | # Sieve filter | |
471 | if header "x-1" "1" { discard; } | |
472 | **** | |
473 | exim -bf test-data <aux-fixed/TESTNUM.message3 | |
474 | **** | |
475 | catwrite test-data | |
476 | # Sieve filter | |
477 | if not header "x-1" "=?ISO-8859-1?Q?=31?=" { discard; } | |
478 | **** | |
479 | exim -bf test-data <aux-fixed/TESTNUM.message3 | |
480 | **** | |
481 | catwrite test-data | |
482 | # Sieve filter | |
483 | if header "x-1b" "=?ISO-8859-1?Q?=31=" { discard; } | |
484 | **** | |
485 | exim -bf test-data <aux-fixed/TESTNUM.message3 | |
486 | **** | |
487 | catwrite test-data | |
488 | # Sieve filter | |
489 | if header "x-b64" "This is BASE64" { discard; } | |
490 | **** | |
491 | exim -bf test-data <aux-fixed/TESTNUM.message3 | |
492 | **** | |
493 | catwrite test-data | |
494 | # Sieve filter | |
495 | if header "x-b64-broken" "=?iso-8859-1?b?VGhpcyBpcyBCQVNFNjQ?=" { discard; } | |
496 | **** | |
497 | exim -bf test-data <aux-fixed/TESTNUM.message3 | |
498 | **** | |
499 | catwrite test-data | |
500 | # Sieve filter | |
501 | if header "x-q75total" "0123456789012345678901234567890123456789012345678901234567" { discard; } | |
502 | **** | |
503 | exim -bf test-data <aux-fixed/TESTNUM.message3 | |
504 | **** | |
505 | catwrite test-data | |
506 | # Sieve filter | |
507 | if header "x-q76total" "=?ISO-8859-1?Q?01234567890123456789012345678901234567890123456789012345678?=" { discard; } | |
508 | **** | |
509 | exim -bf test-data <aux-fixed/TESTNUM.message3 | |
510 | **** | |
511 | catwrite test-data | |
512 | # Sieve filter | |
513 | if header "X-Wrapped" "eins zwei drei" { discard; } | |
514 | **** | |
515 | exim -bf test-data <aux-fixed/TESTNUM.message3 | |
516 | **** | |
517 | catwrite test-data | |
518 | # Sieve filter | |
519 | if header "x-nomimewrap" "=?iso-8859-1?q?abc def ghi?=" { discard; } | |
520 | **** | |
521 | exim -bf test-data <aux-fixed/TESTNUM.message3 | |
522 | **** | |
523 | catwrite test-data | |
524 | # Sieve filter | |
525 | if header "subject" "abcdefghi" { discard; } | |
526 | **** | |
527 | exim -bf test-data <aux-fixed/TESTNUM.message3 | |
528 | **** | |
529 | catwrite test-data | |
530 | # Sieve filter | |
531 | if header "x-mixed" "abc def" { discard; } | |
532 | **** | |
533 | exim -bf test-data <aux-fixed/TESTNUM.message3 | |
534 | **** | |
535 | catwrite test-data | |
536 | #Sieve filter | |
537 | if true { stop; fileinto "inbox.never"; } | |
538 | **** | |
539 | exim -bf test-data <aux-fixed/TESTNUM.message3 | |
540 | **** |