1 # Sieve tests using -bf
5 if address ["From","To"] "marian@abcdefgh.example"
8 exim -bf test-data <aux-fixed/TESTNUM.message
12 if address :is "From" "marian@abcdefgh.example"
15 exim -bf test-data <aux-fixed/TESTNUM.message
19 if address :is "To" "marian@abcdefgh.example"
22 exim -bf test-data <aux-fixed/TESTNUM.message
26 if address :contains "To" "abcdefgh"
29 exim -bf test-data <aux-fixed/TESTNUM.message
33 if address :matches "To" "*abc?efgh*"
36 exim -bf test-data <aux-fixed/TESTNUM.message
42 exim -bf test-data <aux-fixed/TESTNUM.message
48 exim -bf test-data <aux-fixed/TESTNUM.message
52 if allof (false,false) { discard; }
54 exim -bf test-data <aux-fixed/TESTNUM.message
58 if allof (true,false) { discard; }
60 exim -bf test-data <aux-fixed/TESTNUM.message
64 if allof (false,true) { discard; }
66 exim -bf test-data <aux-fixed/TESTNUM.message
70 if allof (true,true) { discard; }
72 exim -bf test-data <aux-fixed/TESTNUM.message
76 if anyof (false,false) { discard; }
78 exim -bf test-data <aux-fixed/TESTNUM.message
82 if anyof (true,false) { discard; }
84 exim -bf test-data <aux-fixed/TESTNUM.message
88 if anyof (false,true) { discard; }
90 exim -bf test-data <aux-fixed/TESTNUM.message
94 if anyof (true,true) { discard; }
96 exim -bf test-data <aux-fixed/TESTNUM.message
100 if not anyof (false,false) { discard; }
102 exim -bf test-data <aux-fixed/TESTNUM.message
106 if not anyof (true,false) { discard; }
108 exim -bf test-data <aux-fixed/TESTNUM.message
112 if not anyof (false,true) { discard; }
114 exim -bf test-data <aux-fixed/TESTNUM.message
118 if not anyof (true,true) { discard; }
120 exim -bf test-data <aux-fixed/TESTNUM.message
124 if header "to" "MARIAN@abcdefgh.example" { discard; }
126 exim -bf test-data <aux-fixed/TESTNUM.message
130 if header :comparator "i;octet" "to" "MARIAN@abcdefgh.example" { discard; }
132 exim -bf test-data <aux-fixed/TESTNUM.message
136 if header :comparator "i;ascii-casemap" "to" "MARIAN@abcdefgh.example" { discard; }
138 exim -bf test-data <aux-fixed/TESTNUM.message
143 if envelope "from" "marian@somenet.example" { discard; }
145 exim -bf test-data <aux-fixed/TESTNUM.message
150 if envelope "from" "offerqn@bpk.example.com" { discard; }
152 exim -bf test-data <aux-fixed/TESTNUM.message
156 if exists [ "X-NotHere", "X-Notheretoo" ] { discard; }
158 exim -bf test-data <aux-fixed/TESTNUM.message
162 if exists [ "X-NotHere", "Delivered-To" ] { discard; }
164 exim -bf test-data <aux-fixed/TESTNUM.message
168 if exists [ "From", "Delivered-To" ] { discard; }
170 exim -bf test-data <aux-fixed/TESTNUM.message
174 if header :contains "X-NotHere" "" { discard; }
176 exim -bf test-data <aux-fixed/TESTNUM.message
180 if header "Delivered-To" "" { discard; }
182 exim -bf test-data <aux-fixed/TESTNUM.message
186 if header :contains "Delivered-To" "" { discard; }
188 exim -bf test-data <aux-fixed/TESTNUM.message
192 if header :contains "Delivered-To" "rc@irc.somenet.example" { discard; }
194 exim -bf test-data <aux-fixed/TESTNUM.message
198 if header "Delivered-To" ["irc@irc.somenet.example"] { discard; }
200 exim -bf test-data <aux-fixed/TESTNUM.message
204 if header "Delivered-To" ["irc@irc.somenet.example","irc@01019somenet.example","some.one"] { discard; }
206 exim -bf test-data <aux-fixed/TESTNUM.message
210 if header "Mime-Version" "1.0" { discard; }
212 exim -bf test-data <aux-fixed/TESTNUM.message
216 if false { discard; }
218 exim -bf test-data <aux-fixed/TESTNUM.message
224 exim -bf test-data <aux-fixed/TESTNUM.message
228 if true { discard; } else { keep; }
230 exim -bf test-data <aux-fixed/TESTNUM.message
234 if false { keep; } else { discard; }
236 exim -bf test-data <aux-fixed/TESTNUM.message
240 if false { keep; } elsif true { discard; } else { keep; }
242 exim -bf test-data <aux-fixed/TESTNUM.message
246 if true { discard; } elsif true { keep; } else { keep; }
248 exim -bf test-data <aux-fixed/TESTNUM.message
254 { if true { discard; } else { keep; } }
256 exim -bf test-data <aux-fixed/TESTNUM.message
260 if header :matches "to" "MA*AN@abc*fg?.example" { discard; }
262 exim -bf test-data <aux-fixed/TESTNUM.message
266 if not header :matches "to" "MA?AN@abc*fg?.example" { discard; }
268 exim -bf test-data <aux-fixed/TESTNUM.message
272 if header :matches "to" "*marian@abcdefgh.example" { discard; }
274 exim -bf test-data <aux-fixed/TESTNUM.message
278 if not header :matches "to" "?marian@abcdefgh.example" { discard; }
280 exim -bf test-data <aux-fixed/TESTNUM.message
284 if header :matches "to" "marian@abcdefgh.example*" { discard; }
286 exim -bf test-data <aux-fixed/TESTNUM.message
290 if not header :matches "to" "marian@abcdefgh.example?" { discard; }
292 exim -bf test-data <aux-fixed/TESTNUM.message
296 if header :matches "x-special1" "\\?*\\*" { discard; }
298 exim -bf test-data <aux-fixed/TESTNUM.message
302 if header :matches "x-special1" "*\0*" { discard; }
304 exim -bf test-data <aux-fixed/TESTNUM.message
308 if not header :matches "x-special1" "*\0*q" { discard; }
310 exim -bf test-data <aux-fixed/TESTNUM.message
314 require "encoded-character";
315 if not header :matches "x-special1" "*${hex:00}*" { discard; }
317 exim -bf test-data <aux-fixed/TESTNUM.message
321 if not header :matches "x-special2" "\\?*\\*" { discard; }
323 exim -bf test-data <aux-fixed/TESTNUM.message
327 if not header :matches "x-special2" "*\0*" { discard; }
329 exim -bf test-data <aux-fixed/TESTNUM.message
337 exim -bf test-data <aux-fixed/TESTNUM.message
345 exim -bf test-data <aux-fixed/TESTNUM.message
349 if size :under 4K { discard; }
351 exim -bf test-data <aux-fixed/TESTNUM.message
355 if size :under 400 { discard; }
357 exim -bf test-data <aux-fixed/TESTNUM.message
363 exim -bf test-data <aux-fixed/TESTNUM.message
367 # no filter line here
368 if unknowntest { keep; }
371 exim -bf test-data <aux-fixed/TESTNUM.message
377 exim -bf test-data <aux-fixed/TESTNUM.message
383 exim -bf test-data <aux-fixed/TESTNUM.message
387 if true { unknownaction; }
389 exim -bf test-data <aux-fixed/TESTNUM.message
393 if true { fileinto abcdefgh; }
395 exim -bf test-data <aux-fixed/TESTNUM.message
400 if true { fileinto "abcdefgh"; }
402 exim -bf test-data <aux-fixed/TESTNUM.message
406 if header ["to"] [ "marian@abcdefgh.example", "achnee"] { discard; }
408 exim -bf test-data <aux-fixed/TESTNUM.message
412 if header "to" [ "egal", "achnee" { keep; }
414 exim -bf test-data <aux-fixed/TESTNUM.message
418 if header "to","from"] "egal" { keep; }
420 exim -bf test-data <aux-fixed/TESTNUM.message
424 if header ["to","from" "egal" { keep; }
426 exim -bf test-data <aux-fixed/TESTNUM.message
430 if header ["to",,"from"] "egal" { keep; }
432 exim -bf test-data <aux-fixed/TESTNUM.message
436 if header ["to",] "egal" { keep; }
438 exim -bf test-data <aux-fixed/TESTNUM.message
442 if header [,"to"] "egal" { keep; }
444 exim -bf test-data <aux-fixed/TESTNUM.message
448 if unknowntest { keep; }
450 exim -bf test-data <aux-fixed/TESTNUM.message
454 if header :matches "to" "egal" { keep; }
456 exim -bf test-data <aux-fixed/TESTNUM.message
460 if header :unknown "to" "egal" { keep; }
462 exim -bf test-data <aux-fixed/TESTNUM.message
467 require ["fileinto", "envelope"];
469 if header :matches "X-Warning" "* is listed at list.dsbl.org*"
471 keep; # keep in "In" folder
474 exim -bf test-data <aux-fixed/TESTNUM.message2
478 if header "x-1" "1" { discard; }
480 exim -bf test-data <aux-fixed/TESTNUM.message3
484 if not header "x-1" "=?ISO-8859-1?Q?=31?=" { discard; }
486 exim -bf test-data <aux-fixed/TESTNUM.message3
490 if header "x-1b" "=?ISO-8859-1?Q?=31=" { discard; }
492 exim -bf test-data <aux-fixed/TESTNUM.message3
496 if header "x-b64" "This is BASE64" { discard; }
498 exim -bf test-data <aux-fixed/TESTNUM.message3
502 if header "x-b64-broken" "=?iso-8859-1?b?VGhpcyBpcyBCQVNFNjQ?=" { discard; }
504 exim -bf test-data <aux-fixed/TESTNUM.message3
508 if header "x-q75total" "0123456789012345678901234567890123456789012345678901234567" { discard; }
510 exim -bf test-data <aux-fixed/TESTNUM.message3
514 if header "x-q76total" "=?ISO-8859-1?Q?01234567890123456789012345678901234567890123456789012345678?=" { discard; }
516 exim -bf test-data <aux-fixed/TESTNUM.message3
520 if header "X-Wrapped" "eins zwei drei" { discard; }
522 exim -bf test-data <aux-fixed/TESTNUM.message3
526 if header "x-nomimewrap" "=?iso-8859-1?q?abc def ghi?=" { discard; }
528 exim -bf test-data <aux-fixed/TESTNUM.message3
532 if header "subject" "abcdefghi" { discard; }
534 exim -bf test-data <aux-fixed/TESTNUM.message3
538 if header "x-mixed" "abc def" { discard; }
540 exim -bf test-data <aux-fixed/TESTNUM.message3
544 if true { stop; fileinto "inbox.never"; }
546 exim -bf test-data <aux-fixed/TESTNUM.message3