Commiting my example/test sieve scripts so I can maintain them with cvs
(I use them at work and home).
Showing
2 changed files
with
353 additions
and
0 deletions
sieve/examples/Test
0 → 100755
1 | #!/bin/sh | ||
2 | |||
3 | # set -x | ||
4 | |||
5 | cp INBOX.orig INBOX | ||
6 | |||
7 | echo == Parse testing | ||
8 | for t in ex-*.sv | ||
9 | do | ||
10 | echo Test: $t | ||
11 | ../sieve -ncv -f `pwd`/INBOX $t | ||
12 | done | ||
13 | |||
14 | for t in exn-*.sv | ||
15 | do | ||
16 | echo Test: $t might fail | ||
17 | #../sieve -ncv -f `pwd`/INBOX $t || true | ||
18 | done | ||
19 | |||
20 | echo == Action testing | ||
21 | for t in ex-*.sv | ||
22 | do | ||
23 | cp INBOX.orig INBOX | ||
24 | echo | ||
25 | echo Test: $t | ||
26 | ../sieve -v -f `pwd`/INBOX $t | ||
27 | done | ||
28 |
sieve/examples/test.out
0 → 100644
1 | == Parse testing | ||
2 | Test: ex-1.10.2.sv | ||
3 | Test: ex-2.3a.sv | ||
4 | Test: ex-2.5.1.sv | ||
5 | Test: ex-2.7.3.sv | ||
6 | Test: ex-3.1a.sv | ||
7 | Test: ex-3.1b.sv | ||
8 | Test: ex-3.2.sv | ||
9 | Test: ex-4.1.sv | ||
10 | Test: ex-4.2.sv | ||
11 | Test: ex-4.4a.sv | ||
12 | Test: ex-4.4b.sv | ||
13 | Test: ex-4.5.sv | ||
14 | Test: ex-5.1.sv | ||
15 | Test: ex-5.7.sv | ||
16 | Test: ex-9.sv | ||
17 | Test: ex-null.sv | ||
18 | Test: exn-2.3b.sv might fail | ||
19 | Test: exn-5.4.sv might fail | ||
20 | == Action testing | ||
21 | |||
22 | Test: ex-1.10.2.sv | ||
23 | mbox had 2 messages... | ||
24 | getsize -> 587 | ||
25 | action => DISCARD | ||
26 | action => KEEP | ||
27 | Action(s) taken: | ||
28 | Discarded | ||
29 | Kept | ||
30 | |||
31 | getsize -> 539 | ||
32 | action => DISCARD | ||
33 | action => KEEP | ||
34 | Action(s) taken: | ||
35 | Discarded | ||
36 | Kept | ||
37 | |||
38 | |||
39 | Test: ex-2.3a.sv | ||
40 | mbox had 2 messages... | ||
41 | getsize -> 587 | ||
42 | action => DISCARD | ||
43 | Action(s) taken: | ||
44 | Discarded | ||
45 | |||
46 | getsize -> 539 | ||
47 | action => KEEP | ||
48 | Action(s) taken: | ||
49 | Kept | ||
50 | |||
51 | |||
52 | Test: ex-2.5.1.sv | ||
53 | mbox had 2 messages... | ||
54 | getheader, filling cache with 4 fields | ||
55 | getheader, cacheing X-Caffeine=C8H10N4O2 | ||
56 | getheader, cacheing Subject=I have a present for you | ||
57 | getheader, cacheing To=roadrunner@acme.example.com | ||
58 | getheader, cacheing From=coyote@desert.example.org | ||
59 | getheader, From=coyote@desert.example.org | ||
60 | getheader Date, failed No such file or directory | ||
61 | getheader, from=coyote@desert.example.org | ||
62 | action => DISCARD | ||
63 | action => FILEINTO | ||
64 | into <popbox> | ||
65 | fail with [2] no handler for this type of mailbox | ||
66 | runtime error: Fileinto: no handler for this type of mailbox | ||
67 | Action(s) taken: | ||
68 | Discarded | ||
69 | Fileinto action failed: no handler for this type of mailbox | ||
70 | |||
71 | sieve_execute_script(1): sieve -1237848064 rc No error | ||
72 | |||
73 | Test: ex-2.7.3.sv | ||
74 | mbox had 2 messages... | ||
75 | getheader, filling cache with 4 fields | ||
76 | getheader, cacheing X-Caffeine=C8H10N4O2 | ||
77 | getheader, cacheing Subject=I have a present for you | ||
78 | getheader, cacheing To=roadrunner@acme.example.com | ||
79 | getheader, cacheing From=coyote@desert.example.org | ||
80 | getheader, Subject=I have a present for you | ||
81 | action => KEEP | ||
82 | Action(s) taken: | ||
83 | Kept | ||
84 | |||
85 | getheader, filling cache with 4 fields | ||
86 | getheader, cacheing Date=TBD | ||
87 | getheader, cacheing Subject=$$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$ | ||
88 | getheader, cacheing To=rube@landru.example.edu | ||
89 | getheader, cacheing From=youcouldberich!@reply-by-postal-mail.invalid | ||
90 | getheader, Subject=$$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$ | ||
91 | action => KEEP | ||
92 | Action(s) taken: | ||
93 | Kept | ||
94 | |||
95 | |||
96 | Test: ex-3.1a.sv | ||
97 | mbox had 2 messages... | ||
98 | getheader, filling cache with 4 fields | ||
99 | getheader, cacheing X-Caffeine=C8H10N4O2 | ||
100 | getheader, cacheing Subject=I have a present for you | ||
101 | getheader, cacheing To=roadrunner@acme.example.com | ||
102 | getheader, cacheing From=coyote@desert.example.org | ||
103 | getheader, from=coyote@desert.example.org | ||
104 | action => DISCARD | ||
105 | Action(s) taken: | ||
106 | Discarded | ||
107 | |||
108 | getheader, filling cache with 4 fields | ||
109 | getheader, cacheing Date=TBD | ||
110 | getheader, cacheing Subject=$$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$ | ||
111 | getheader, cacheing To=rube@landru.example.edu | ||
112 | getheader, cacheing From=youcouldberich!@reply-by-postal-mail.invalid | ||
113 | getheader, from=youcouldberich!@reply-by-postal-mail.invalid | ||
114 | getheader, subject=$$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$ | ||
115 | action => DISCARD | ||
116 | Action(s) taken: | ||
117 | Discarded | ||
118 | |||
119 | |||
120 | Test: ex-3.1b.sv | ||
121 | mbox had 2 messages... | ||
122 | getheader, filling cache with 4 fields | ||
123 | getheader, cacheing X-Caffeine=C8H10N4O2 | ||
124 | getheader, cacheing Subject=I have a present for you | ||
125 | getheader, cacheing To=roadrunner@acme.example.com | ||
126 | getheader, cacheing From=coyote@desert.example.org | ||
127 | getheader, From=coyote@desert.example.org | ||
128 | action => REDIRECT | ||
129 | Action(s) taken: | ||
130 | Redirected to acm@example.edu | ||
131 | |||
132 | getheader, filling cache with 4 fields | ||
133 | getheader, cacheing Date=TBD | ||
134 | getheader, cacheing Subject=$$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$ | ||
135 | getheader, cacheing To=rube@landru.example.edu | ||
136 | getheader, cacheing From=youcouldberich!@reply-by-postal-mail.invalid | ||
137 | getheader, From=youcouldberich!@reply-by-postal-mail.invalid | ||
138 | getheader, Subject=$$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$ | ||
139 | action => REDIRECT | ||
140 | Action(s) taken: | ||
141 | Redirected to postmaster@example.edu | ||
142 | |||
143 | |||
144 | Test: ex-3.2.sv | ||
145 | mbox had 2 messages... | ||
146 | action => KEEP | ||
147 | Action(s) taken: | ||
148 | Kept | ||
149 | |||
150 | action => KEEP | ||
151 | Action(s) taken: | ||
152 | Kept | ||
153 | |||
154 | |||
155 | Test: ex-4.1.sv | ||
156 | mbox had 2 messages... | ||
157 | getheader, filling cache with 4 fields | ||
158 | getheader, cacheing X-Caffeine=C8H10N4O2 | ||
159 | getheader, cacheing Subject=I have a present for you | ||
160 | getheader, cacheing To=roadrunner@acme.example.com | ||
161 | getheader, cacheing From=coyote@desert.example.org | ||
162 | getheader, from=coyote@desert.example.org | ||
163 | action => REJECT | ||
164 | Action(s) taken: | ||
165 | Rejected with: I am not taking mail from you, and I don't want | ||
166 | your birdseed, either! | ||
167 | |||
168 | getheader, filling cache with 4 fields | ||
169 | getheader, cacheing Date=TBD | ||
170 | getheader, cacheing Subject=$$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$ | ||
171 | getheader, cacheing To=rube@landru.example.edu | ||
172 | getheader, cacheing From=youcouldberich!@reply-by-postal-mail.invalid | ||
173 | getheader, from=youcouldberich!@reply-by-postal-mail.invalid | ||
174 | action => KEEP | ||
175 | Action(s) taken: | ||
176 | Kept | ||
177 | |||
178 | |||
179 | Test: ex-4.2.sv | ||
180 | mbox had 2 messages... | ||
181 | getheader, filling cache with 4 fields | ||
182 | getheader, cacheing X-Caffeine=C8H10N4O2 | ||
183 | getheader, cacheing Subject=I have a present for you | ||
184 | getheader, cacheing To=roadrunner@acme.example.com | ||
185 | getheader, cacheing From=coyote@desert.example.org | ||
186 | getheader, from=coyote@desert.example.org | ||
187 | action => FILEINTO | ||
188 | into <INBOX.harassment> | ||
189 | fail with [2] no handler for this type of mailbox | ||
190 | runtime error: Fileinto: no handler for this type of mailbox | ||
191 | Action(s) taken: | ||
192 | Fileinto action failed: no handler for this type of mailbox | ||
193 | |||
194 | sieve_execute_script(1): sieve -1237848064 rc No error | ||
195 | |||
196 | Test: ex-4.4a.sv | ||
197 | mbox had 2 messages... | ||
198 | getsize -> 587 | ||
199 | action => KEEP | ||
200 | Action(s) taken: | ||
201 | Kept | ||
202 | |||
203 | getsize -> 539 | ||
204 | action => KEEP | ||
205 | Action(s) taken: | ||
206 | Kept | ||
207 | |||
208 | |||
209 | Test: ex-4.4b.sv | ||
210 | mbox had 2 messages... | ||
211 | getsize -> 587 | ||
212 | action => KEEP | ||
213 | Action(s) taken: | ||
214 | Kept | ||
215 | |||
216 | getsize -> 539 | ||
217 | action => KEEP | ||
218 | Action(s) taken: | ||
219 | Kept | ||
220 | |||
221 | |||
222 | Test: ex-4.5.sv | ||
223 | mbox had 2 messages... | ||
224 | getheader, filling cache with 4 fields | ||
225 | getheader, cacheing X-Caffeine=C8H10N4O2 | ||
226 | getheader, cacheing Subject=I have a present for you | ||
227 | getheader, cacheing To=roadrunner@acme.example.com | ||
228 | getheader, cacheing From=coyote@desert.example.org | ||
229 | getheader, from=coyote@desert.example.org | ||
230 | action => KEEP | ||
231 | Action(s) taken: | ||
232 | Kept | ||
233 | |||
234 | getheader, filling cache with 4 fields | ||
235 | getheader, cacheing Date=TBD | ||
236 | getheader, cacheing Subject=$$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$ | ||
237 | getheader, cacheing To=rube@landru.example.edu | ||
238 | getheader, cacheing From=youcouldberich!@reply-by-postal-mail.invalid | ||
239 | getheader, from=youcouldberich!@reply-by-postal-mail.invalid | ||
240 | action => KEEP | ||
241 | Action(s) taken: | ||
242 | Kept | ||
243 | |||
244 | |||
245 | Test: ex-5.1.sv | ||
246 | mbox had 2 messages... | ||
247 | getheader, filling cache with 4 fields | ||
248 | getheader, cacheing X-Caffeine=C8H10N4O2 | ||
249 | getheader, cacheing Subject=I have a present for you | ||
250 | getheader, cacheing To=roadrunner@acme.example.com | ||
251 | getheader, cacheing From=coyote@desert.example.org | ||
252 | getheader, from=coyote@desert.example.org | ||
253 | action => KEEP | ||
254 | Action(s) taken: | ||
255 | Kept | ||
256 | |||
257 | getheader, filling cache with 4 fields | ||
258 | getheader, cacheing Date=TBD | ||
259 | getheader, cacheing Subject=$$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$ | ||
260 | getheader, cacheing To=rube@landru.example.edu | ||
261 | getheader, cacheing From=youcouldberich!@reply-by-postal-mail.invalid | ||
262 | getheader, from=youcouldberich!@reply-by-postal-mail.invalid | ||
263 | action => KEEP | ||
264 | Action(s) taken: | ||
265 | Kept | ||
266 | |||
267 | |||
268 | Test: ex-5.7.sv | ||
269 | mbox had 2 messages... | ||
270 | getheader, filling cache with 4 fields | ||
271 | getheader, cacheing X-Caffeine=C8H10N4O2 | ||
272 | getheader, cacheing Subject=I have a present for you | ||
273 | getheader, cacheing To=roadrunner@acme.example.com | ||
274 | getheader, cacheing From=coyote@desert.example.org | ||
275 | getheader, X-Caffeine=C8H10N4O2 | ||
276 | getheader, X-Caffeine=C8H10N4O2 | ||
277 | action => KEEP | ||
278 | Action(s) taken: | ||
279 | Kept | ||
280 | |||
281 | getheader, filling cache with 4 fields | ||
282 | getheader, cacheing Date=TBD | ||
283 | getheader, cacheing Subject=$$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$ | ||
284 | getheader, cacheing To=rube@landru.example.edu | ||
285 | getheader, cacheing From=youcouldberich!@reply-by-postal-mail.invalid | ||
286 | getheader X-Caffeine, failed No such file or directory | ||
287 | getheader X-Caffeine, failed No such file or directory | ||
288 | action => DISCARD | ||
289 | Action(s) taken: | ||
290 | Discarded | ||
291 | |||
292 | |||
293 | Test: ex-9.sv | ||
294 | mbox had 2 messages... | ||
295 | getsize -> 587 | ||
296 | getheader, filling cache with 4 fields | ||
297 | getheader, cacheing X-Caffeine=C8H10N4O2 | ||
298 | getheader, cacheing Subject=I have a present for you | ||
299 | getheader, cacheing To=roadrunner@acme.example.com | ||
300 | getheader, cacheing From=coyote@desert.example.org | ||
301 | getheader Sender, failed No such file or directory | ||
302 | getheader, From=coyote@desert.example.org | ||
303 | getheader, To=roadrunner@acme.example.com | ||
304 | getheader, To=roadrunner@acme.example.com | ||
305 | getheader Cc, failed No such file or directory | ||
306 | getheader Bcc, failed No such file or directory | ||
307 | action => FILEINTO | ||
308 | into <spam> | ||
309 | fail with [2] no handler for this type of mailbox | ||
310 | runtime error: Fileinto: no handler for this type of mailbox | ||
311 | Action(s) taken: | ||
312 | Fileinto action failed: no handler for this type of mailbox | ||
313 | |||
314 | sieve_execute_script(1): sieve -1237848064 rc No such file or directory | ||
315 | |||
316 | Test: ex-null.sv | ||
317 | mbox had 2 messages... | ||
318 | action => KEEP | ||
319 | Action(s) taken: | ||
320 | Kept | ||
321 | |||
322 | action => KEEP | ||
323 | Action(s) taken: | ||
324 | Kept | ||
325 |
-
Please register or sign in to post a comment