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