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 if not header :matches "x-special2" "\\?*\\*" { discard; }
316 exim -bf test-data <aux-fixed/TESTNUM.message
320 if not header :matches "x-special2" "*\0*" { discard; }
322 exim -bf test-data <aux-fixed/TESTNUM.message
330 exim -bf test-data <aux-fixed/TESTNUM.message
338 exim -bf test-data <aux-fixed/TESTNUM.message
342 if size :under 4K { discard; }
344 exim -bf test-data <aux-fixed/TESTNUM.message
348 if size :under 400 { discard; }
350 exim -bf test-data <aux-fixed/TESTNUM.message
356 exim -bf test-data <aux-fixed/TESTNUM.message
360 # no filter line here
361 if unknowntest { keep; }
364 exim -bf test-data <aux-fixed/TESTNUM.message
370 exim -bf test-data <aux-fixed/TESTNUM.message
376 exim -bf test-data <aux-fixed/TESTNUM.message
380 if true { unknownaction; }
382 exim -bf test-data <aux-fixed/TESTNUM.message
386 if true { fileinto abcdefgh; }
388 exim -bf test-data <aux-fixed/TESTNUM.message
393 if true { fileinto "abcdefgh"; }
395 exim -bf test-data <aux-fixed/TESTNUM.message
399 if header ["to"] [ "marian@abcdefgh.example", "achnee"] { discard; }
401 exim -bf test-data <aux-fixed/TESTNUM.message
405 if header "to" [ "egal", "achnee" { keep; }
407 exim -bf test-data <aux-fixed/TESTNUM.message
411 if header "to","from"] "egal" { keep; }
413 exim -bf test-data <aux-fixed/TESTNUM.message
417 if header ["to","from" "egal" { keep; }
419 exim -bf test-data <aux-fixed/TESTNUM.message
423 if header ["to",,"from"] "egal" { keep; }
425 exim -bf test-data <aux-fixed/TESTNUM.message
429 if header ["to",] "egal" { keep; }
431 exim -bf test-data <aux-fixed/TESTNUM.message
435 if header [,"to"] "egal" { keep; }
437 exim -bf test-data <aux-fixed/TESTNUM.message
441 if unknowntest { keep; }
443 exim -bf test-data <aux-fixed/TESTNUM.message
447 if header :matches "to" "egal" { keep; }
449 exim -bf test-data <aux-fixed/TESTNUM.message
453 if header :unknown "to" "egal" { keep; }
455 exim -bf test-data <aux-fixed/TESTNUM.message
460 require ["fileinto", "envelope"];
462 if header :matches "X-Warning" "* is listed at list.dsbl.org*"
464 keep; # keep in "In" folder
467 exim -bf test-data <aux-fixed/TESTNUM.message2
471 if header "x-1" "1" { discard; }
473 exim -bf test-data <aux-fixed/TESTNUM.message3
477 if not header "x-1" "=?ISO-8859-1?Q?=31?=" { discard; }
479 exim -bf test-data <aux-fixed/TESTNUM.message3
483 if header "x-1b" "=?ISO-8859-1?Q?=31=" { discard; }
485 exim -bf test-data <aux-fixed/TESTNUM.message3
489 if header "x-b64" "This is BASE64" { discard; }
491 exim -bf test-data <aux-fixed/TESTNUM.message3
495 if header "x-b64-broken" "=?iso-8859-1?b?VGhpcyBpcyBCQVNFNjQ?=" { discard; }
497 exim -bf test-data <aux-fixed/TESTNUM.message3
501 if header "x-q75total" "0123456789012345678901234567890123456789012345678901234567" { discard; }
503 exim -bf test-data <aux-fixed/TESTNUM.message3
507 if header "x-q76total" "=?ISO-8859-1?Q?01234567890123456789012345678901234567890123456789012345678?=" { discard; }
509 exim -bf test-data <aux-fixed/TESTNUM.message3
513 if header "X-Wrapped" "eins zwei drei" { discard; }
515 exim -bf test-data <aux-fixed/TESTNUM.message3
519 if header "x-nomimewrap" "=?iso-8859-1?q?abc def ghi?=" { discard; }
521 exim -bf test-data <aux-fixed/TESTNUM.message3
525 if header "subject" "abcdefghi" { discard; }
527 exim -bf test-data <aux-fixed/TESTNUM.message3
531 if header "x-mixed" "abc def" { discard; }
533 exim -bf test-data <aux-fixed/TESTNUM.message3
537 if true { stop; fileinto "inbox.never"; }
539 exim -bf test-data <aux-fixed/TESTNUM.message3