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