Fix ${run } arg parsing
[exim.git] / test / stdout / 0002
1
2 > # These expansions can test variables in the configuration, but as there
3 > # is no message being processed, there is no message-related data. But
4 > # that of course gets tested in plenty of other places.
5
6 > # Some fixed variables
7
8 > exim_path: TESTSUITE/eximdir/exim
9 > exim_version: x.yz
10 > config_dir: TESTSUITE
11 > config_file: TESTSUITE/test-config
12 > primary_hostname: myhost.test.ex
13 > primary_hostname: myhost.test.ex
14 > qualify_domain: myhost.test.ex
15 > bounce_return_size_limit: 102400
16 > spool_directory: TESTSUITE/spool
17 > queue_name: 
18 > Failed: unknown variable in "${unknown}"
19 > h_subject: (should be empty)
20 > h_subject: (should be empty)
21 > Failed: unknown expansion operator "header_subject"
22
23 > # $message_headers should be empty
24 > message_headers: ><
25
26 > # Continuation
27 > xy
28 > xy
29
30 > # Overlong names and overbig numbers
31
32 > Failed: unknown variable name "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
33 > Failed: unknown variable in "${aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}"
34 > +
35 > +
36
37 > eval:   0
38 > eval:   1
39 > eval:   -1
40 > eval:   1
41 > eval:   2
42 > eval:   7
43 > eval:   9
44 > eval:   4
45 > eval:   6
46 > eval:   42
47 > Failed: error in expression evaluation: expecting number or opening parenthesis (after processing "")
48 > eval:   -2
49 > eval:   1
50 > eval:   1
51 > Failed: error in expression evaluation: expecting closing parenthesis (after processing "-2 - (-3")
52 > Failed: error in expression evaluation: expecting operator (after processing "-2 - -3")
53 > eval:   1
54 > eval:   -5
55 > eval:   1
56 > eval:   40962
57 > eval:   63
58 > Failed: error in expression evaluation: expecting operator (after processing "0")
59 > eval10: 77
60 > eval10: 8
61 > Failed: error in expression evaluation: expecting operator (after processing "0")
62 > eval:   4
63 > eval:   4
64 > eval:   4
65 > eval:   13
66 > eval:   9
67 > eval:   6
68 > eval:   3
69 > eval:   0
70 > eval:   24
71 > eval:   4608
72 > eval:   4608
73 > eval:   -4608
74
75 > # List operations
76
77 > filter: "a:b:c"
78 > filter: a:c
79 > filter: a'c
80 > filter: ''a' ''c
81 > filter: ""
82 > # check operation when the condition modifies the 'value' variable
83 > E
84
85 > map: ""
86 > map: a:b:c
87 > map: ::a::: ::b::: ::c::
88 > map: fail string
89 > map: []:[b]:[c]
90
91 > reduce: "+"
92 > reduce: +abc
93 > reduce: 6
94 > reduce: 9
95 > # Check for extract corrupting reduce's 
96 > reduce: a , b
97
98 > listnamed: *.aa.bb : ^\Nxxx(.*)
99 > listnamed: *.aa.bb : ^\Nxxx(.*)
100 > listnamed: V4NET.11.12.13 : iplsearch;TESTSUITE/aux-fixed/0002.iplsearch
101 > listnamed: *.aa.bb : ^\Nxxx(.*) : ;;
102 > listnamed: a : b;c : *.aa.bb : ^\Nxxx(.*) : ;; : 2001::630::212::8::204::::b664
103 > Failed: "nolist" is not a named list
104 > listnamed: *.aa.bb : ^\Nxxx(.*)
105 > Failed: "hlist" is not a domain named list
106 > Failed: bad suffix on "list" operator
107
108 > listcount: 3
109 > listcount: 0
110 > listcount: 3
111 > listcount: 2
112
113 > listextract: b
114 > listextract: XcX
115 > listextract: 
116 > listextract: 
117 > listextract: fail
118 > Failed: "listextract" failed and "fail" requested
119
120 > listquote: abcd
121 > listquote: ab::cd
122 > listquote: ::a::b::c::d::
123 > listquote: ab::::cd
124 > listquote: ab:cd
125 > listquote: ab;;cd
126 > listquote:   ab  cd
127 > listquote: < >
128
129 > sort: 1:2:3:4
130 > sort: 4,3,2,1
131 > sort: a:aa:B:c
132 > sort: 10 smtp.ex.com:100 r2.ex.com:666 r99.ex.com
133 > sort: 10,smtp.ex.com:100,r2.ex.com:666,r99.ex.com
134 > sort: ""
135
136 > # Tests with iscntrl() and illegal separators
137
138 > map: 'a'
139 ''
140 'b'
141 'c'
142
143 > Failed: error in expression evaluation: expecting number or opening parenthesis (after processing "0+") inside "reduce" item
144 > reduce: 6
145 > reduce: 6
146 > reduce: 6
147
148 > # Operators
149
150 > Failed: Not enough arguments for 'acl' (min is 1)
151 > Failed: Not enough arguments for 'acl' (min is 1)
152 > Failed: ERROR from acl "a_nosuch"
153 > acl: (0) [] []
154 > acl: (1) [person@dom.ain] []
155 > acl: (2) [firstarg] [secondarg]
156 > acl: (1) [arg with spaces] []
157 > acl: 
158 > acl: 
159 > acl: (0) [] []
160 > acl: (1) [person@dom.ain] []
161 > Failed: DEFER from acl "a_defer"
162 > acl: (2) [new arg1] [top_arg_1]
163 > acl:  (1) [1] [] (1) [2] [] (1) [3] [] (1) [4] []
164
165 > addrss: local-part@dom.ain
166 > addrss: local-part@dom.ain
167 > addrss: local-part@dom.ain
168 > addrss: local-part@dom.ain
169 > addrss: local-part@dom.ain
170 > addrss: local-part.dot-atom@dom.ain
171 > addrss: local-part@dom.ain
172 > domain: dom.ain
173 > domain: dom.ain
174 > domain: dom.ain
175 > domain: 
176
177 > addresses: ''abc@xyz' ''pqr@xyz
178 > addresses: local-part@dom.ain
179 > addresses: local-part@dom.ain+xyz@abc
180 > addresses: local-part@dom.ain:xyz@abc:p@q:r@s
181 > addresses: 
182 > Failed: output separator missing in expanding ${addresses:>}
183
184 > escape:     B7\267F2\362
185 > excape8bit: undisturbed text  tab
186 newline tab\134backslash ~tilde\177DEL\200\201.
187
188 > expand: $primary_hostname myhost.test.ex
189 > hash:   jmg monty fbWx
190 > hash:   abcX abX aX X
191 > hex2b64:EjRWeA==
192 > hex2b64:q83v
193 > hex2b64:q83v
194 > hex2b64:Gis8TV5v
195 > Failed: "1a2b3c4d5e6" contains an odd number of characters
196 > Failed: "1a2b3c4d5e6g" is not a hex string
197 > hex2b64:MPPJPkZDbetYunCBao7BJA==
198 > hex2b64:ztcfpyNSMb7Tg/rP3EHE3cwi7PE=
199
200 > base32: 0  <>
201 > base32: 1  <b>
202 > base32: 31 <7>
203 > base32: 32 <ba>
204 > base32: 42 <bk>
205 > Failed: argument for base32 operator is "0x1", which is not a decimal number
206
207 > base32d: 0  0
208 > base32d: 1  1
209 > base32d: 31 31
210 > base32d: 32 32
211 > base32d: 42 42
212 > Failed: argument for base32d operator is "ABC", which is not a base 32 number
213
214 > the base62 operator is actually a base36 operator in the Darwin and Cygwin
215 > environments. Write cunning tests that produce the same output in both cases,
216 > while doing a reasonable check.
217
218 > base62:  OK
219 > base62d: OK
220 > base62d: OK
221 > Failed: argument for base62 operator is "12345x", which is not a decimal number
222 > Failed: argument for base62d operator is "0003D7.", which is not a base 36/62 number
223
224 > hmac:   dd97e3ba5d1a61b5006108f8c8252953
225 > hmac:   0210cf9d274b53f1550f657c378b29e8bfed1064
226 > md5:    77add1d5f41223d5582fca736a5cb335
227 > sha1:   DA39A3EE5E6B4B0D3255BFEF95601890AFD80709
228 > sha1:   A9993E364706816ABA3E25717850C26C9CD0D89D
229 > mask:   192.168.10.192/28
230 > mask:   192.168.10.206/32
231 > Failed: mask value too big in "192.168.10.206/33"
232 > mask:   0.0.0.0/0
233 > Failed: missing mask value in "192.168.10.206"
234 > Failed: "a.b.c.d" is not an IP address
235 > mask:   2a00.0002.0003.0004.0004.0000.0000.0000/79
236 > mask:   2a00.0002.0003.0004.0005.0006.0007.0008/128
237 > Failed: mask value too big in "2a00:2:3:4:5:6:7:8/129"
238 > mask_n: 2a00:2:3:4:4::/79
239 > ipv6denorm: 0000:0000:0000:0000:0000:0000:0000:0001
240 > ipv6denorm: fe00:0000:0000:0000:0000:0000:0000:0001
241 > ipv6denorm: 0000:0000:0000:0000:0000:ffff:c0a8:0001
242 > ipv6denorm: fe80:0000:0000:0000:0000:0000:c0a8:0001
243 > ipv6norm:   ::1
244 > ipv6norm:   2a00::
245 > ipv6norm:   2a00::1
246 > ipv6norm:   2a00:eadf::1:0
247 > ipv6norm:   2a00:eadf:0:1::
248 > ipv6norm:   2a00::
249 > ipv6norm:   2a00:2:3:4:5:6:7:8trailing_text
250 > nhash:  19 0/61
251 > lc/uc:  the quick  BROWN FOX
252 > length: The quick  abc
253 > lclpt:  local-part
254 > lclpt:  local-part
255 > lclpt:  local.part
256 > lclpt:  a.b.c
257 > quote:  aZ09_.-Q "ab*cd" "abcd\"ef"
258 > quote:  "nl(\n)"
259 > quote:  "cr(\r)"
260 > quote:  "tab( )"
261 > quote:  "xff(ÿ)"
262 > quote:  Empty>""<
263 > quote_local_part: abcd
264 > quote_local_part: O'Reilly
265 > quote_local_part: "a space"
266 > quote_local_part: ".something"
267 > quote_local_part: "something."
268 > quote_local_part: joe.bloggs
269 > quote_local_part: a!b
270 > quote_local_part: "x@y"
271 > quote_local_part: ab*cd
272 > quote_local_part: "x:y"
273 > quote_local_part: "abcd\"ef"
274 > quote_local_part: ""
275 > rxquote:aZ09\_\,\-Q ab\*cd abcd\"ef
276 > hexquote: \x01\x02\x03\x04\x05\x06\x07\x20\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x20\x10\x11\x12\x13\x14\x15\x16\x17\x20\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x20!"#$%&'\x20()*+,-./\x2001234567\x2089:;<=>?\x20@ABCDEFG\x20HIJKLMNO\x20PQRSTUVW\x20XYZ[\]^_\x20`abcdefg\x20hijklmno\x20pqrstuvw\x20xyz{|}~\x7f
277 > substr: ba 34  1
278 > substr: barb rhuba
279 > substr: 
280 > substr: 
281 > str2b64:YWJjZA==
282 > str2b64:VGhlIHF1aWNrIGJyb3duIAogZm94
283 > base64: YWJjZA==
284 > base64: VGhlIHF1aWNrIGJyb3duIAogZm94
285 > base64d:abcd
286 > base64d:The quick brown 
287  fox
288 > strlen: 0
289 > strlen: 1
290 > strlen: 8
291 > time_eval:     10
292 > time_eval:     7200
293 > time_eval:     86700
294 > time_eval:     788645
295 > Failed: string "14" is not an Exim time interval in "time_eval" operator
296 > Failed: string "rhubarb" is not an Exim time interval in "time_eval" operator
297 > time_interval: 0s
298 > time_interval: 44s
299 > time_interval: 1w4d13h46m39s
300 > Failed: string "-1" is not a positive number in "time_interval" operator
301 > Failed: string "rhubarb" is not a positive number in "time_interval" operator
302
303 > # stat is a bit tricky, but some of the fields of the aux-var directory
304 > # should be the same on all systems
305
306 > stat:   40755
307 > stat:   drwxr-xr-x
308 > Failed: stat(/a/non/existent/file) failed: No such file or directory
309
310 > # "Operators" that have expanded arguments
311
312 > hash:   jmg monty fbWx
313 > hash:   abcX abX aX X
314 > nhash:  19 0/61
315 > length: The quick  abc
316 > substr: ba 34  1
317 > substr: 
318
319 > # Error forms
320
321 > Failed: Not enough arguments for 'hash' (min is 2)
322 > Failed: "nonnumber" is not a number (in "hash" expansion)
323 > Failed: Too many arguments for 'hash' (max is 3)
324 > Failed: "-2" is not a positive number (in "substr" expansion)
325
326 > # Skipped operators
327
328 > addrss: NO
329 > domain: NO
330 > escape: NO
331 > expand: NO
332 > hash:   NO
333 > md5:    NO
334 > mask:   NO
335
336 > # Number suffixes in conditions
337 > 1k: y
338 > 1K: y
339 > 1M: y
340 > 1G: y
341
342 > # Numeric overflow
343 > # >32b should work, >64b not
344
345 > 1 > 2047M                n
346 > 1 > 2048M                n
347 > 1 > 4096000000           n
348 > 1 > 4096M                n
349 > 1 > 4611686018427387904  n
350 > Failed: absolute value of integer "46116860184273879040" is too large (overflow)
351
352 > # Conditions
353
354 > 2=2:    y
355 > 2==2:   y
356 > 3=2:    n
357 > 2==3:   n
358 > !2=2:   n
359 > !2==2:  n
360 > !3=2:   y
361 > !2==3:  y
362 > 2>3:    n
363 > 3>3:    n
364 > 4>3:    y
365 > 1>-1:   y
366 > 2>=3:   n
367 > 3>=3:   y
368 > 4>=3:   y
369 > 2<3:    y
370 > 3<3:    n
371 > 4<3:    n
372 > 2<=3:   y
373 > 3<=3:   y
374 > 4<=3:   n
375 > 5<=3:   n
376 > -3<=1:  y
377
378 > 5>3k:   n
379 > 5>3m:   n
380 > Failed: invalid integer "3z "
381 > Failed: integer expected but "a" found
382 > Failed: integer expected but "${substr_2_2:65535}" found
383
384 > >0:     n
385 > =:      y
386 > -2<:    y
387 > 08>07:  y
388 > 011=11: y
389
390 > def:y   y
391 > def:n   n
392 > Failed: unknown variable "post" after "def:"
393 > def:h_f n
394 > def:h_f n
395 > Failed: curly-bracket problem in conditional yes/no parsing: 'yes' part did not start with '{'
396  remaining string is ':{y}{n}}'
397
398 > exists: y
399 > exists: n
400
401 > eq:     y
402 > eq:     n
403 > !eq:    n
404 > !eq:    y
405
406 > eqi:    y
407 > eqi:    y
408 > eqi:    n
409 > !eqi:   n
410 > !eqi:   n
411 > !eqi:   y
412
413 > lt:     y
414 > lti:    n
415 > le:     y
416 > lei:    y
417 > gt:     n
418 > gti:    n
419 > ge:     n
420 > gei:    y
421
422 > isip:   y  1.2.3.4
423 > isip4:  y  1.2.3.4
424 > isip6:  n  1.2.3.4
425 > isip:   n  ::1.2.3.256
426 > isip4:  n  1.2.3.256
427 > isip:   n  1:2:3:4
428 > isip4:  n  1:2:3:4
429 > isip6:  n  1:2:3:4
430 > isip:   y      ::1
431 > isip4:  n      ::1
432 > isip6:  y      ::1
433 > isip:   y  fe80::a00:20ff:fe86:a061
434 > isip4:  n  fe80::a00:20ff:fe86:a061
435 > isip6:  y  fe80::a00:20ff:fe86:a061
436 > isip:   y  fe80::1.2.3.4
437 > isip:   n  rhubarb
438 > isip4:  n  rhubarb
439 > isip6:  n  rhubarb
440
441 > match:  cdab
442 > match:  cdab
443 > match:  cdab
444 > Failed: "if" failed and "fail" requested
445 > match:  cd[xyz]ab
446 > # check for empty capture group
447 > match:  <>
448
449 > match_domain:    yes
450 > match_domain:    no
451 > match_domain:    yes
452 > match_domain:    yes
453 > match_domain:    no
454
455 >  >x@zz.aa.bb< [zz] >x@zz.aa.bb< 
456
457 >  >x@xxxabc< [abc] >x@xxxabc< 
458
459 > match_address:   yes
460 > match_address:   yes
461
462 > match_local_part:yes
463 > match_local_part:yes
464
465 > match_ip:        01 true
466 > match_ip:        02 
467 > match_ip:        03 true
468 > match_ip:        04 true
469 > match_ip:        05 
470 > match_ip:        06 
471 > match_ip:        07 true
472 > match_ip:        08 true
473 > match_ip:        09 
474 > match_ip:        10 true
475 > Failed: "somename" is not an IP address
476 > match_ip:        12 true
477 > match_ip:        13 true
478 > match_ip:        14 true
479 > match_ip:        15 true
480
481 > queue_running:  n
482 > first_delivery: n
483
484 > queue_running after or: y
485 > first_delivery after or: y
486
487 > # acl expansion condition
488 > acl if: Y:(0) [] []
489 > acl if: Y:(1) [argY] []
490 > acl if: N:(2) [argN] [arg2]
491 > Failed: DEFER from acl "a_defer"
492
493 > # Default values for both if strings
494
495 > ${if eq{1}{1}}  >true<
496 > ${if eq{1}{2}}  ><
497
498 > # Lookups: DIR is the testing directory. In this test we can only use the
499 > # lookups that are required in all cases.
500
501 > CALLER
502 > postmaster: CALLER
503
504 > ==X@Y
505 > ==*
506 > ==*@Z
507 > ==*
508
509 > x@y  ==X@Y
510 > *    ==*
511 > *@z  ==*@Z
512 > *    ==*
513
514 > data for a.b.c.d
515 > failed x.y.z
516 > data for *.p.q
517 > data for *.p.q
518 > data for *.p.q
519 > Failed: "lookup" failed and "fail" requested
520 > data for *
521
522 > a.b.c.d: data for a.b.c.d
523 > failed x.y.z
524 > *.p.q:   data for *.p.q
525 > *.p.q:   data for *.p.q
526 > *.p.q:   data for *.p.q
527 > Failed: "lookup" failed and "fail" requested
528 > *:       data for *
529
530 > q1:  "abc"
531 > q2:  "xyz":
532 > q3:  "pqr"  :
533 > q4:  "a:b" abc continued data (make sure not key)
534 > q5:  "\"quoted\""
535 > q6:  "white space"
536 > q7:  "b\\s"
537
538 > q1f: abc           "abc"
539 > q2f: xyz:          "xyz":
540 > q3f: pqr  :        "pqr"  :
541 > q4f: a:b           "a:b" abc continued data (make sure not key)
542 > q5f: "quoted"    "\"quoted\""
543 > q6f: white space   "white space"
544 > q7f: b\s          "b\\s"
545
546 > abc:   abc
547 > a.b.c: *.b.c
548 > ab.c:  *b.c
549 > xyz:   ^X
550 > .Xyz:   ^X
551 > .Zyz:   ^Z
552 > a b:   "^a +b"
553 > a  b:  "^a +b"
554 > a:b:   lookup succeeded
555 > a.b:   ^a\\.+b
556 > a..b:  ^a\\.+b
557 > a9b:   \N^a\d+b
558 > a99b:  \N^a\d+b
559
560 > # Should give the same results as above because expansion does nothing
561
562 > abc:   abc
563 > a.b.c: *.b.c
564 > ab.c:  *b.c
565 > xyz:   ^X
566 > .Xyz:   ^X
567 > .Zyz:   ^Z
568 > a b:   "^a +b"
569 > a  b:  "^a +b"
570 > a:b:   lookup succeeded
571
572 > # Should fail because of no expansion
573
574 > a.b:   NO
575 > a..b:  NO
576 > a9b:   NO
577 > a99b:  NO
578
579 > # But these should succeed
580
581 > a\:b:  ^a\\.+b
582 > a\:Xb: ^a\\.+b
583
584 > # Some tests of case-(in)dependence
585
586 > .MiXeD-CD:  Data found for case-dependent MiXeD-CD
587 > .MixeD-CD:  NOT FOUND
588 > .MiXeD-Ncd: Data found for case-independent MiXeD-nCD
589 > .MixeD-Ncd: Data found for case-independent MiXeD-nCD
590
591 > # IP address (CIDR) lookups
592
593 > 1.2.3.4:      data for 1.2.3.4
594 > 1.2.3.5:      
595 > 1.2.3.5:      data for *
596 > abcd::cdab:   data for abcd::cdab
597 > 192.168.1.2:  data for 192.168.0.0/16
598 > 192.168.5.6:  data for 192.168.0.0/16
599 > abcd:abcd::   data for abcd:abcd::/32
600 > abcd:abcd:1:: data for abcd:abcd::/32
601 > abcd:abcd::3  data for abcd:abcd::/32
602 > Failed: lookup of "rhubarb" gave DEFER: "rhubarb" is not a valid iplsearch key (an IP address, with optional CIDR mask, is wanted): in a host list, use net-iplsearch as the search type
603
604
605 > # Nested Lookups - style 1
606
607 > The data for key1->key2
608 > Failed: "lookup" failed and "fail" requested
609
610 > # Nested Lookups - style 2
611
612 > The data for key1->key2
613 > failed for key4
614
615 > # Other nesting tests
616
617 > 1-in-1
618 > 2-in-2
619 > both-in-1,both-in-2
620 > Failed: "lookup" failed and "fail" requested
621
622 > # Lookup quotes for standardly expected lookups
623
624 > lsearch  !@#$%^&*()_-+=|\~`1234567890{[}]qwertyuiop:;"'asdfghjkl<,>.?/zxcvbnm
625 > Failed: unknown lookup type "xxx"
626
627 > # Extract
628
629 > 2
630 > 2
631 > 2
632 > 2
633 > empty:<>
634 > empty:<>
635 > <3>
636 > <3>
637 > empty:<>
638 > empty:<>
639 > no Z
640 > no 4
641 > Failed: "extract" failed and "fail" requested
642 > Failed: "extract" failed and "fail" requested
643 > D
644 > a:b:c:d:e
645 > a
646 > e
647 > a
648 > FAIL
649 > b
650
651 > b
652 > three four
653 > Failed: first argument of "extract" must not be empty
654 > Failed: first argument of "extract" must not be empty
655 > b
656
657 > a:b:c
658 > Failed: missing '}' closing extract inside "map" item
659 > a:b:c
660
661 > # Translation
662
663 > abcdea aaa xyz zbcdez
664 > abcdea a   z   zbcdez
665 > abcdea a       abcdea
666 > abcdea abc z   zzzdez
667
668 > # Boolean
669 > "TrUe"                true      EXPECT: true
670 > "FALSE"               false     EXPECT: false
671 > " yes"                true      EXPECT: true
672 > " no"                 false     EXPECT: false
673 > "yes "                true      EXPECT: true
674 > "-1"                  true     EXPECT: true
675 > "0"                   false     EXPECT: false
676 > "1"                   true      EXPECT: true
677 > " 0 "                 false     EXPECT: false
678 > " 1 "                 true      EXPECT: true
679 > "1111111111111111111" true      EXPECT: true
680 > "9"                   true      EXPECT: true
681 > " "                   false     EXPECT: false
682 > Failed: unrecognised boolean value "text"
683 > Failed: unrecognised boolean value "text"
684 > Failed: unrecognised boolean value "-text"
685 > Failed: unrecognised boolean value "text"
686 > Failed: unrecognised boolean value "text"
687 > "00"                  false     EXPECT: false
688 > "!true"               false     EXPECT: false
689 > "!false"              true      EXPECT: true
690
691 > "TrUe"                true      EXPECT: true
692 > "FALSE"               false     EXPECT: false
693 > " yes"                true      EXPECT: true
694 > " no"                 false     EXPECT: false
695 > "yes "                true      EXPECT: true
696 > "-1"                  true      EXPECT: true
697 > "0"                   false     EXPECT: false
698 > "1"                   true      EXPECT: true
699 > " 0 "                 false     EXPECT: false
700 > " 1 "                 true      EXPECT: true
701 > "1111111111111111111" true      EXPECT: true
702 > "9"                   true      EXPECT: true
703 > " "                   false     EXPECT: false
704 > "text"                true      EXPECT: true
705 > " text"               true      EXPECT: true
706 > "text "               true      EXPECT: true
707 > " text "              true      EXPECT: true
708 > "00"                  true      EXPECT: true
709 > "!true"               false     EXPECT: false
710 > "!false"              true      EXPECT: true
711
712 > # RFC 2047
713
714 > abcd      abcd
715 > <:abcd:>  =?iso-8859-8?Q?=3C=3Aabcd=3A=3E?=
716 > <:ab cd:> =?iso-8859-8?Q?=3C=3Aab_cd=3A=3E?=
717 > long:     =?iso-8859-8?Q?_here_we_go=3A_a_string_that_is_going_to_be_encoded=3A_it_will_go_ov?= =?iso-8859-8?Q?er_the_75-char_limit?=
718 > long:     =?iso-8859-8?Q?_here_we_go=3A_a_string_that_is_going_to_be_encoded=3A_it_will_go_ov?= =?iso-8859-8?Q?er_the_75-char_limit_by_a_long_way=3B_in_fact_this_on?= =?iso-8859-8?Q?e_will_go_over_the_150_character_limit?=
719
720 > # RFC 2047 decode
721
722 > abcd      abcd
723 > <:abcd:>  <:abcd:>
724 > <:ab cd:> <:ab cd:>
725 > Long:      here we go: a string that is going to be encoded: it will go over the 75-char limit
726 > Long:      here we go: a string that is going to be encoded: it will go over the 75-char limit by a long way; in fact this one will go over the 150 character limit
727
728 > # UTF-8
729
730 > abcd      abcd
731 > aÀÿd      aÀÿd
732 > toobig    a_d
733
734 > # Substitution
735
736 > ${sg{abcdefabcdef}{abc}{xyz}}          =xyzdefxyzdef
737 > ${sg{ab:xy::z}{:}{::}}                 =ab::xy::::z
738 > ${sg{abcdefabcdef}{(..)[^c]}{>$1<}}    =a><><><ef
739 > ${sg{abcdefabcdef}{(..)[^c]}{>\$1<}}   =a>bc<>ef<>bc<ef
740 > ${sg{abcdefabcdef}{(..)[^c]}{>\N$1\N<}}=a>bc<>ef<>bc<ef
741 > ${sg{abbab}{a*}{+}}                    =++b+b++b+
742
743 > # File insertion
744
745 > Failed: Not enough arguments for 'readfile' (min is 1)
746 > abcde
747 12345
748
749 xyz
750
751 > abcde12345xyz
752 > abcde:12345::xyz:
753 > abcde - 12345 -  - xyz - 
754 > Failed: failed to open /non/exist/file: No such file or directory
755 > non-exist
756 > >abcde!12345!!xyz!<
757
758 > # Calling a command
759
760 > abcd
761 1234
762
763 > rc=0
764 > 1
765 > rc=0
766 > abcd
767 1234
768
769 > rc=0
770 > 2
771 > rc=1
772 > abcd
773 1234
774
775 > rc=1
776 > N
777 > rc=127
778 > >><<
779 > rc=0
780 > 1!=2
781 > rc=0
782 > abcd
783 1234
784
785 > rc=0
786 > 2
787 > rc=1
788
789 > # PRVS
790
791 > prvs=xxxxxxxxxx=userx@test.ex
792 > prvs=xxxxxxxxxx=userx@test.ex
793 > prvs=xxxxxxxxxx=userx@test.ex
794
795 > # Syntax errors
796
797 > Failed: prvs third argument must be a single digit
798 > Failed: prvs third argument must be a single digit
799 > Failed: prvs third argument must be a single digit
800
801 > # Correct checks; can't put explicit addresses in the tests, because they
802 > # will change over time.
803
804 > userx@test.ex
805 > result=1
806
807 > >1< >userx@test.ex< >1<
808 > result=1
809
810 > userx@test.ex
811 > result=1
812
813 > # Incorrect secret
814
815 > userx@test.ex
816 > result=
817
818 > 0
819 > result=
820
821 > # Non-prvs address
822
823 > >><<
824 > result=
825
826 > # Syntax errors
827
828 > Failed: "${tod_log" is not a known operator (or a } is missing in a variable reference)
829 > Failed: "${tod_log" is not a known operator (or a } is missing in a variable reference)
830 > Failed: missing } at end of string
831 > Failed: missing } at end of string
832 > Failed: hmac algorithm "xxx" is not recognised
833 > Failed: each subcondition inside an "and{...}" condition must be in its own {}
834 > Failed: unknown condition "xya" inside "and{...}" condition
835 > Failed: condition name expected, but found "${lookup{x}lsear" inside "and{...}" condition
836 > Failed: missing } at end of string - could be header name not terminated by colon
837 > Failed: curly-bracket problem in conditional yes/no parsing: did not close with '}'
838  remaining string is ''
839 > Failed: missing or misplaced { or } - could be header name not terminated by colon
840 > Failed: each subcondition inside an "or{...}" condition must be in its own {}
841 > Failed: missing } at end of condition inside "or" group
842 > Failed: unknown condition "yes" inside "or{...}" condition
843 > Failed: non-digit after underscore in "substr_1_"
844 > Failed: non-digit after underscore in "substr__3"
845
846 > # Iterations: forany and forall
847
848 > yes
849 > yes
850 > yes
851 > no
852 > yes
853 > no
854 > no
855 > yes
856 > yes
857
858 > Failed: unknown condition "yes" inside "forany" condition
859 > Failed: missing } at end of condition inside "forany"
860
861 > yes
862 > no
863 > no
864 > no
865
866 > no
867 > yes
868 > yes
869 > yes
870
871 > # Expect yes
872 > outer=yes item='' (unset)
873
874 > # Expect no
875 > outer=no
876
877 > # Error inside nest - check message is helpful
878 > Failed: missing } at end of condition inside "forall" inside "forany" condition
879
880
881 > # Miscellaneous (for bug fixes, etc)
882
883 > true
884
885 > # Environment access
886
887 > CALLER
888 > correct
889
890 > # JSON
891
892 > "http://www.example.com/image/481989943"
893 > 100
894 > 943
895 > 943
896
897 > "green"
898 > green
899 > <>
900 > expect: <>
901
902 > 59
903 > 59
904
905 > {"1":116, "2":943, "3":234}
906 > expect: {"1":116, "2":943, "3":234}
907
908 > {"1":116, "2":943, "3":234}
909 > expect: {"1":116, "2":943, "3":234}
910
911 > <>
912 > expect: <>
913 > <>
914 > expect: <>
915
916 > yes
917 > yes
918
919
920 > escape: B7·F2ò
921
922 > primary_hostname: myhost.test.ex
923 > sender_address: sndr@dom
924 > match:  cdab
925 > Failed: "if" failed and "fail" requested
926 > yes
927 > match_address:   no
928
929 > primary_hostname: myhost.test.ex
930 > match:  cdab
931 > Failed: "if" failed and "fail" requested
932 > yes
933 > match_address:   no
934
935 > -be Sender host name and address etc, all unset
936 > -oMa  sender_host_address = 
937 >       sender_host_port = 0
938 > -oMaa sender_host_authenticated = 
939 > -oMai authenticated_id = CALLER
940 > -oMas authenticated_sender = CALLER@myhost.test.ex
941 > -oMi  interface_address = 
942 >       interface_port = -1
943 > -oMr  received_protocol = 
944 > -oMs  sender_host_name = 
945 > -oMt  sender_ident = CALLER
946
947 > -be Sender host name and address etc, all set except host name.
948 > -oMa  sender_host_address = V4NET.0.0.1
949 >       sender_host_port = 1234
950 > -oMaa sender_host_authenticated = AAA
951 > -oMai authenticated_id = philip
952 > -oMas authenticated_sender = xx@yy.zz
953 > -oMi  interface_address = 1.1.1.1
954 >       interface_port = 99
955 > -oMr  received_protocol = special
956 > -oMt  sender_ident = me
957
958 > -be Sender host name explicitly set
959 > -oMa  sender_host_address = V4NET.0.0.1
960 >       sender_host_port = 1234
961 > -oMs  sender_host_name = my.host.name
962
963 > be Sender host name lookup fails (V4NET.11.12.13 is not reverse registered)
964 > -oMs  sender_host_name = 
965 >       host_lookup_failed = 1
966
967 > -be Sender host name and protocol set by Sendmail-compatible option
968 > -p  received_protocol = special
969 > -p  sender_host_name = host.name
970
971 > -be Sender host name and address etc, all set except host name
972 > -oMa  sender_host_address = V4NET.0.0.1
973 >       sender_host_port = 1234
974 > -oMaa sender_host_authenticated = AAA
975 > -oMai authenticated_id = philip
976 > -oMas authenticated_sender = xx@yy.zz
977 > -oMi  interface_address = 1.1.1.1
978 >       interface_port = 99
979 > -oMr  received_protocol = special
980 > ----> No lookup yet: No
981 > -oMs  sender_host_name = ten-1.test.ex
982 > -oMt  sender_ident = me
983
984
985 **** SMTP testing session as if from host V4NET.0.0.1
986 **** but without any ident (RFC 1413) callback.
987 **** This is not for real!
988
989 550 Administrative prohibition\r
990
991 **** SMTP testing session as if from host V4NET.0.0.2
992 **** but without any ident (RFC 1413) callback.
993 **** This is not for real!
994
995 550 Administrative prohibition\r
996
997 **** SMTP testing session as if from host V4NET.0.0.0
998 **** but without any ident (RFC 1413) callback.
999 **** This is not for real!
1000
1001 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
1002 250 myhost.test.ex Hello test [V4NET.0.0.0]\r
1003 250 OK\r
1004 250 Accepted\r
1005 354 Enter message, ending with "." on a line by itself\r
1006 550 reply_address=<>\r
1007 250 OK\r
1008 250 Accepted\r
1009 354 Enter message, ending with "." on a line by itself\r
1010 550 reply_address=<a@b>\r
1011 250 OK\r
1012 250 Accepted\r
1013 354 Enter message, ending with "." on a line by itself\r
1014 550 reply_address=<c@d>\r
1015 250 OK\r
1016 250 Accepted\r
1017 354 Enter message, ending with "." on a line by itself\r
1018 550 reply_address=<>\r
1019 250 OK\r
1020 250 Accepted\r
1021 354 Enter message, ending with "." on a line by itself\r
1022 550 reply_address=<x@y>\r
1023 221 myhost.test.ex closing connection\r
1024
1025 **** SMTP testing session as if from host V4NET.0.0.0
1026 **** but without any ident (RFC 1413) callback.
1027 **** This is not for real!
1028
1029 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
1030 250 myhost.test.ex Hello test [V4NET.0.0.0]\r
1031 250 OK\r
1032 250 Accepted\r
1033 354 Enter message, ending with "." on a line by itself\r
1034 550 reply_address=<>\r
1035 221 myhost.test.ex closing connection\r
1036
1037 **** SMTP testing session as if from host V4NET.0.0.0
1038 **** but without any ident (RFC 1413) callback.
1039 **** This is not for real!
1040
1041 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
1042 250 myhost.test.ex Hello test [V4NET.0.0.0]\r
1043 250 OK\r
1044 250 Accepted\r
1045 354 Enter message, ending with "." on a line by itself\r
1046 550 reply_address=<>\r
1047 221 myhost.test.ex closing connection\r
1048 > match_ip:        15 
1049 > match_ip:        16 
1050
1051 > in list
1052 > in list
1053
1054 > '${listextract {2} {<. my.target.host.name}}'  =>   'target'
1055