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