Add bitwise logical operators to ${eval:
[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 > primary_hostname: myhost.test.ex
10 > primary_hostname: myhost.test.ex
11 > qualify_domain: myhost.test.ex
12 > bounce_return_size_limit: 102400
13 > spool_directory: TESTSUITE/spool
14 > Failed: unknown variable in "${unknown}"
15 > h_subject: (should be empty)
16 > h_subject: (should be empty)
17 > Failed: unknown expansion operator "header_subject"
18
19 > # $message_headers should be empty
20 > message_headers: ><
21
22 > # Continuation
23 > xy
24 > xy
25
26 > # Overlong names and overbig numbers
27
28 > Failed: unknown variable name "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
29 > Failed: unknown variable in "${aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}"
30 > +
31 > +
32
33 > # Operators
34
35 > addrss: local-part@dom.ain
36 > addrss: local-part@dom.ain
37 > domain: dom.ain
38 > domain: dom.ain
39 > escape: B7\267F2\362
40 > eval:   2
41 > eval:   7
42 > eval:   9
43 > eval:   4
44 > eval:   6
45 > eval:   42
46 > Failed: error in expression evaluation: expecting number or opening parenthesis (after processing "")
47 > eval:   -2
48 > eval:   1
49 > eval:   1
50 > Failed: error in expression evaluation: expecting closing parenthesis (after processing "-2 - (-3")
51 > Failed: error in expression evaluation: expecting operator (after processing "-2 - -3")
52 > eval:   1
53 > eval:   -5
54 > eval:   1
55 > eval:   40962
56 > eval:   63
57 > Failed: error in expression evaluation: expecting operator (after processing "0")
58 > eval10: 77
59 > eval10: 8
60 > Failed: error in expression evaluation: expecting operator (after processing "0")
61 > eval:   4
62 > eval:   4
63 > eval:   4
64 > eval:   13
65 > eval:   9
66 > eval:   6
67 > eval:   3
68 > eval:   0
69 > eval:   24
70 > eval:   4608
71 > eval:   4608
72 > eval:   -4608
73
74 > expand: $primary_hostname myhost.test.ex
75 > hash:   jmg monty fbWx
76 > hash:   abcX abX aX X
77 > hex2b64:EjRWeA==
78 > hex2b64:q83v
79 > hex2b64:q83v
80 > hex2b64:Gis8TV5v
81 > Failed: "1a2b3c4d5e6" contains an odd number of characters
82 > Failed: "1a2b3c4d5e6g" is not a hex string
83 > hex2b64:MPPJPkZDbetYunCBao7BJA==
84 > hex2b64:ztcfpyNSMb7Tg/rP3EHE3cwi7PE=
85
86 > The base62 operator is actually a base36 operator in the Darwin and Cygwin
87 > environments. Write cunning tests that produce the same output in both cases,
88 > while doing a reasonable check.
89
90 > base62:  OK
91 > base62d: OK
92 > base62d: OK
93 > Failed: argument for base62 operator is "12345x", which is not a decimal number
94 > Failed: argument for base62d operator is "0003D7.", which is not a base 36/62 number
95
96 > hmac:   dd97e3ba5d1a61b5006108f8c8252953
97 > hmac:   0210cf9d274b53f1550f657c378b29e8bfed1064
98 > md5:    77add1d5f41223d5582fca736a5cb335
99 > sha1:   DA39A3EE5E6B4B0D3255BFEF95601890AFD80709
100 > sha1:   A9993E364706816ABA3E25717850C26C9CD0D89D
101 > mask:   192.168.10.192/28
102 > mask:   192.168.10.206/32
103 > Failed: mask value too big in "192.168.10.206/33"
104 > mask:   0.0.0.0/0
105 > Failed: missing mask value in "192.168.10.206"
106 > Failed: "a.b.c.d" is not an IP address
107 > nhash:  19 0/61
108 > lc/uc:  the quick  BROWN FOX
109 > length: The quick  abc
110 > lclpt:  local-part
111 > lclpt:  local-part
112 > quote:  aZ09_.-Q "ab*cd" "abcd\"ef"
113 > quote:  "nl(\n)"
114 > quote:  "cr(\r)"
115 > quote:  "tab( )"
116 > quote:  "xff(ÿ)"
117 > quote:  Empty>""<
118 > quote_local_part: abcd
119 > quote_local_part: O'Reilly
120 > quote_local_part: "a space"
121 > quote_local_part: ".something"
122 > quote_local_part: "something."
123 > quote_local_part: joe.bloggs
124 > quote_local_part: a!b
125 > quote_local_part: "x@y"
126 > quote_local_part: ab*cd
127 > quote_local_part: "x:y"
128 > quote_local_part: "abcd\"ef"
129 > quote_local_part: ""
130 > rxquote:aZ09\_\,\-Q ab\*cd abcd\"ef
131 > substr: ba 34  1
132 > substr: barb rhuba
133 > substr: 
134 > substr: 
135 > str2b64:YWJjZA==
136 > str2b64:VGhlIHF1aWNrIGJyb3duIAogZm94
137 > strlen: 0
138 > strlen: 1
139 > strlen: 8
140 > time_eval:     10
141 > time_eval:     7200
142 > time_eval:     86700
143 > time_eval:     788645
144 > Failed: string "14" is not an Exim time interval in "time_eval" operator
145 > Failed: string "rhubarb" is not an Exim time interval in "time_eval" operator
146 > time_interval: 0s
147 > time_interval: 44s
148 > time_interval: 1w4d13h46m39s
149 > Failed: string "-1" is not a positive number in "time_interval" operator
150 > Failed: string "rhubarb" is not a positive number in "time_interval" operator
151
152 > # stat is a bit tricky, but some of the fields of the aux-var directory
153 > # should be the same on all systems
154
155 > stat:   40755
156 > stat:   drwxr-xr-x
157 > Failed: stat(/a/non/existent/file) failed: No such file or directory
158
159 > # "Operators" that have expanded arguments
160
161 > hash:   jmg monty fbWx
162 > hash:   abcX abX aX X
163 > nhash:  19 0/61
164 > length: The quick  abc
165 > substr: ba 34  1
166 > substr: 
167
168 > # Error forms
169
170 > Failed: missing or misplaced { or }
171 > Failed: "nonnumber" is not a number (in "hash" expansion)
172 > Failed: Too many arguments for "hash" (max is 3)
173 > Failed: "-2" is not a positive number (in "substr" expansion)
174
175 > # Skipped operators
176
177 > addrss: NO
178 > domain: NO
179 > escape: NO
180 > expand: NO
181 > hash:   NO
182 > md5:    NO
183 > mask:   NO
184
185 > # Numeric overflow
186
187 > Failed: absolute value of integer "4096M" is too large (overflow)
188 > Failed: absolute value of integer "4096000000" is too large (overflow)
189
190 > # Conditions
191
192 > 2=2:    y
193 > 2==2:   y
194 > 3=2:    n
195 > 2==3:   n
196 > !2=2:   n
197 > !2==2:  n
198 > !3=2:   y
199 > !2==3:  y
200 > 2>3:    n
201 > 3>3:    n
202 > 4>3:    y
203 > 1>-1:   y
204 > 2>=3:   n
205 > 3>=3:   y
206 > 4>=3:   y
207 > 2<3:    y
208 > 3<3:    n
209 > 4<3:    n
210 > 2<=3:   y
211 > 3<=3:   y
212 > 4<=3:   n
213 > 5<=3:   n
214 > -3<=1:  y
215
216 > 5>3k:   n
217 > 5>3m:   n
218 > Failed: invalid integer "3z "
219 > Failed: integer expected but "a" found
220
221 > def:y   y
222 > def:n   n
223 > Failed: unknown variable "post" after "def:"
224 > def:h_f n
225 > def:h_f n
226 > Failed: missing or misplaced { or }
227
228 > exists: y
229 > exists: n
230
231 > eq:     y
232 > eq:     n
233 > !eq:    n
234 > !eq:    y
235
236 > eqi:    y
237 > eqi:    y
238 > eqi:    n
239 > !eqi:   n
240 > !eqi:   n
241 > !eqi:   y
242
243 > lt:     y
244 > lti:    n
245 > le:     y
246 > lei:    y
247 > gt:     n
248 > gti:    n
249 > ge:     n
250 > gei:    y
251
252 > isip:   y  1.2.3.4
253 > isip4:  y  1.2.3.4
254 > isip6:  n  1.2.3.4
255 > isip:   n  1:2:3:4
256 > isip4:  n  1:2:3:4
257 > isip6:  n  1:2:3:4
258 > isip:   y      ::1
259 > isip4:  n      ::1
260 > isip6:  y      ::1
261 > isip:   y  fe80::a00:20ff:fe86:a061
262 > isip4:  n  fe80::a00:20ff:fe86:a061
263 > isip6:  y  fe80::a00:20ff:fe86:a061
264 > isip:   n  rhubarb
265 > isip4:  n  rhubarb
266 > isip6:  n  rhubarb
267
268 > match:  cdab
269 > match:  cdab
270 > match:  cdab
271 > Failed: "if" failed and "fail" requested
272 > match:  cd[xyz]ab
273
274 > match_domain:    yes
275 > match_domain:    no
276 > match_domain:    yes
277 > match_domain:    yes
278 > match_domain:    no
279
280 >  >x@zz.aa.bb< [] >x@zz.aa.bb< 
281
282 >  >x@xxxabc< [] >x@xxxabc< 
283
284 > match_address:   yes
285 > match_address:   yes
286
287 > match_local_part:yes
288 > match_local_part:yes
289
290 > match_ip:        01 true
291 > match_ip:        02 
292 > match_ip:        03 true
293 > match_ip:        04 true
294 > match_ip:        05 
295 > match_ip:        06 
296 > match_ip:        07 true
297 > match_ip:        08 true
298 > match_ip:        09 
299 > match_ip:        10 true
300 > Failed: "somename" is not an IP address
301 > match_ip:        12 true
302 > match_ip:        13 true
303 > match_ip:        14 true
304
305 > queue_running:  n
306 > first_delivery: n
307
308 > queue_running after or: y
309 > first_delivery after or: y
310
311 > # Default values for both if strings
312
313 > ${if eq{1}{1}}  >true<
314 > ${if eq{1}{2}}  ><
315
316 > # Lookups: DIR is the testing directory. In this test we can only use the
317 > # lookups that are required in all cases.
318
319 > CALLER
320
321 > ==X@Y
322 > ==*
323 > ==*@Z
324 > ==*
325
326 > data for a.b.c.d
327 > failed x.y.z
328 > data for *.p.q
329 > data for *.p.q
330 > data for *.p.q
331 > Failed: "lookup" failed and "fail" requested
332 > data for *
333
334 > q1:  "abc"
335 > q2:  "xyz":
336 > q3:  "pqr"  :
337 > q4:  "a:b" abc continued data (make sure not key)
338 > q5:  "\"quoted\""
339 > q6:  "white space"
340 > q7:  "b\\s"
341
342 > abc:   abc
343 > a.b.c: *.b.c
344 > ab.c:  *b.c
345 > xyz:   ^X
346 > Xyz:   ^X
347 > Zyz:   ^Z
348 > a b:   "^a +b"
349 > a  b:  "^a +b"
350 > a:b:   lookup succeeded
351 > a.b:   ^a\\.+b
352 > a..b:  ^a\\.+b
353 > a9b:   \N^a\d+b
354 > a99b:  \N^a\d+b
355
356 > # Should give the same results as above because expansion does nothing
357
358 > abc:   abc
359 > a.b.c: *.b.c
360 > ab.c:  *b.c
361 > xyz:   ^X
362 > Xyz:   ^X
363 > Zyz:   ^Z
364 > a b:   "^a +b"
365 > a  b:  "^a +b"
366 > a:b:   lookup succeeded
367
368 > # Should fail because of no expansion
369
370 > a.b:   NO
371 > a..b:  NO
372 > a9b:   NO
373 > a99b:  NO
374
375 > # But these should succeed
376
377 > a\:b:  ^a\\.+b
378 > a\:Xb: ^a\\.+b
379
380 > # Some tests of case-(in)dependence
381
382 > MiXeD-CD:  Data found for case-dependent MiXeD-CD
383 > MixeD-CD:  NOT FOUND
384 > MiXeD-Ncd: Data found for case-independent MiXeD-nCD
385 > MixeD-Ncd: Data found for case-independent MiXeD-nCD
386
387 > # IP address (CIDR) lookups
388
389 > 1.2.3.4:      data for 1.2.3.4
390 > 1.2.3.5:      
391 > 1.2.3.5:      data for *
392 > abcd::cdab:   data for abcd::cdab
393 > 192.168.1.2:  data for 192.168.0.0/16
394 > 192.168.5.6:  data for 192.168.0.0/16
395 > abcd:abcd::   data for abcd:abcd::/32
396 > abcd:abcd:1:: data for abcd:abcd::/32
397 > abcd:abcd::3  data for abcd:abcd::/32
398 > 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
399
400
401 > # Nested Lookups - style 1
402
403 > The data for key1->key2
404 > Failed: "lookup" failed and "fail" requested
405
406 > # Nested Lookups - style 2
407
408 > The data for key1->key2
409 > failed for key4
410
411 > # Other nesting tests
412
413 > 1-in-1
414 > 2-in-2
415 > both-in-1,both-in-2
416 > Failed: "lookup" failed and "fail" requested
417
418 > # Lookup quotes for standardly expected lookups
419
420 > lsearch  !@#$%^&*()_-+=|\~`1234567890{[}]qwertyuiop:;"'asdfghjkl<,>.?/zxcvbnm
421 > Failed: unknown lookup type "xxx"
422
423 > # Extract
424
425 > 2
426 > 2
427 > 2
428 > 2
429 > Empty:<>
430 > Empty:<>
431 > <3>
432 > <3>
433 > Empty:<>
434 > Empty:<>
435 > no Z
436 > no 4
437 > Failed: "extract" failed and "fail" requested
438 > Failed: "extract" failed and "fail" requested
439 > D
440 > a:b:c:d:e
441 > a
442 > e
443 > a
444 > FAIL
445 > b
446
447 > b
448 > three four
449 > Failed: first argument of "extract" must not be empty
450 > Failed: first argument of "extract" must not be empty
451 > b
452
453 > # Translation
454
455 > abcdea aaa xyz zbcdez
456 > abcdea a   z   zbcdez
457 > abcdea a       abcdea
458 > abcdea abc z   zzzdez
459
460 > # RFC 2047
461
462 > abcd      abcd
463 > <:abcd:>  =?iso-8859-8?Q?=3C=3Aabcd=3A=3E?=
464 > <:ab cd:> =?iso-8859-8?Q?=3C=3Aab_cd=3A=3E?=
465 > Long:     =?iso-8859-8?Q?_here_we_go=3A_a_string_that_is_going_to_be_encoded=3A_i?= =?iso-8859-8?Q?t_will_go_over_the_75-char_limit?=
466 > Long:     =?iso-8859-8?Q?_here_we_go=3A_a_string_that_is_going_to_be_encoded=3A_i?= =?iso-8859-8?Q?t_will_go_over_the_75-char_limit_by_a_long_way=3B_in_fac?= =?iso-8859-8?Q?t_this_one_will_go_over_the_150_character_limit?=
467
468
469 > # UTF-8
470
471 > abcd      abcd
472 > aÀÿd      aÀÿd
473 > toobig    a_d
474
475 > # Substitution
476
477 > ${sg{abcdefabcdef}{abc}{xyz}}          =xyzdefxyzdef
478 > ${sg{ab:xy::z}{:}{::}}                 =ab::xy::::z
479 > ${sg{abcdefabcdef}{(..)[^c]}{>$1<}}    =a><><><ef
480 > ${sg{abcdefabcdef}{(..)[^c]}{>\$1<}}   =a>bc<>ef<>bc<ef
481 > ${sg{abcdefabcdef}{(..)[^c]}{>\N$1\N<}}=a>bc<>ef<>bc<ef
482 > ${sg{abbab}{a*}{+}}                    =++b+b++b+
483
484 > # File insertion
485
486 > Failed: missing or misplaced { or }
487 > abcde
488 12345
489
490 xyz
491
492 > abcde12345xyz
493 > abcde:12345::xyz:
494 > abcde - 12345 -  - xyz - 
495 > Failed: failed to open /non/exist/file: No such file or directory
496 > non-exist
497 > >abcde!12345!!xyz!<
498
499 > # Calling a command
500
501 > abcd
502 1234
503
504 > RC=0
505 > 1
506 > RC=0
507 > abcd
508 1234
509
510 > RC=0
511 > 2
512 > RC=1
513 > abcd
514 1234
515
516 > RC=1
517 > N
518 > RC=127
519 > >><<
520 > RC=0
521 > 1!=2
522 > RC=0
523
524 > # PRVS
525
526 > prvs=userx/xxxxxxxxxx@test.ex
527 > prvs=userx/xxxxxxxxxx@test.ex
528 > prvs=userx/xxxxxxxxxx@test.ex
529
530 > # Syntax errors
531
532 > Failed: prvs second argument must be a single digit
533 > Failed: prvs second argument must be a single digit
534 > Failed: prvs second argument must be a single digit
535
536 > # Correct checks; can't put explicit addresses in the tests, because they
537 > # will change over time.
538
539 > userx@test.ex
540 > result=1
541
542 > >1< >userx@test.ex< >1<
543 > result=1
544
545 > userx@test.ex
546 > result=1
547
548 > # Incorrect secret
549
550 > userx@test.ex
551 > result=
552
553 > 0
554 > result=
555
556 > # Non-prvs address
557
558 > >><<
559 > result=
560
561 > # Syntax errors
562
563 > Failed: "${tod_log" is not a known operator (or a } is missing in a variable reference)
564 > Failed: "${tod_log" is not a known operator (or a } is missing in a variable reference)
565 > Failed: missing } at end of string
566 > Failed: missing } at end of string
567 > Failed: hmac algorithm "xxx" is not recognised
568 > Failed: each subcondition inside an "and{...}" condition must be in its own {}
569 > Failed: unknown condition "xya" inside "and{...}" condition
570 > Failed: condition name expected, but found "${lookup{x}lsear" inside "and{...}" condition
571 > Failed: missing } at end of string - could be header name not terminated by colon
572 > Failed: missing or misplaced { or }
573 > Failed: missing or misplaced { or } - could be header name not terminated by colon
574 > Failed: each subcondition inside an "or{...}" condition must be in its own {}
575 > Failed: missing } at end of condition inside "or" group
576 > Failed: unknown condition "yes" inside "or{...}" condition
577 > Failed: non-digit after underscore in "substr_1_"
578 > Failed: non-digit after underscore in "substr__3"
579
580 > # Miscellaneous (for bug fixes, etc)
581
582 > true
583
584
585 > escape: B7·F2ò
586
587 > primary_hostname: myhost.test.ex
588 > match:  cdab
589 > Failed: "if" failed and "fail" requested
590 > yes
591 > match_address:   no
592
593 > -oMa  sender_host_address = 
594 >       sender_host_port = 0
595 > -oMaa sender_host_authenticated = 
596 > -oMai authenticated_id = CALLER
597 > -oMas authenticated_sender = CALLER@myhost.test.ex
598 > -oMi  interface_address = 
599 >       interface_port = -1
600 > -oMr  received_protocol = 
601 > -oMs  sender_host_name = 
602 > -oMt  sender_ident = CALLER
603
604 > -oMa  sender_host_address = V4NET.0.0.1
605 >       sender_host_port = 1234
606 > -oMaa sender_host_authenticated = AAA
607 > -oMai authenticated_id = philip
608 > -oMas authenticated_sender = xx@yy.zz
609 > -oMi  interface_address = 1.1.1.1
610 >       interface_port = 99
611 > -oMr  received_protocol = special
612 > -oMt  sender_ident = me
613
614 > -oMa  sender_host_address = V4NET.0.0.1
615 >       sender_host_port = 1234
616 > -oMs  sender_host_name = my.host.name
617
618 > -oMs  sender_host_name = 
619 >       host_lookup_failed = 1
620
621 > -p  received_protocol = special
622 > -p  sender_host_name = host.name
623
624 > -oMa  sender_host_address = V4NET.0.0.1
625 >       sender_host_port = 1234
626 > -oMaa sender_host_authenticated = AAA
627 > -oMai authenticated_id = philip
628 > -oMas authenticated_sender = xx@yy.zz
629 > -oMi  interface_address = 1.1.1.1
630 >       interface_port = 99
631 > -oMr  received_protocol = special
632 > ----> No lookup yet: No
633 > -oMs  sender_host_name = ten-1.test.ex
634 > -oMt  sender_ident = me
635
636
637 **** SMTP testing session as if from host V4NET.0.0.1
638 **** but without any ident (RFC 1413) callback.
639 **** This is not for real!
640
641 550 Administrative prohibition\r
642
643 **** SMTP testing session as if from host V4NET.0.0.2
644 **** but without any ident (RFC 1413) callback.
645 **** This is not for real!
646
647 550 Administrative prohibition\r
648
649 **** SMTP testing session as if from host V4NET.0.0.0
650 **** but without any ident (RFC 1413) callback.
651 **** This is not for real!
652
653 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
654 250 OK\r
655 250 Accepted\r
656 354 Enter message, ending with "." on a line by itself\r
657 550 reply_address=<>\r
658 250 OK\r
659 250 Accepted\r
660 354 Enter message, ending with "." on a line by itself\r
661 550 reply_address=<a@b>\r
662 250 OK\r
663 250 Accepted\r
664 354 Enter message, ending with "." on a line by itself\r
665 550 reply_address=<c@d>\r
666 250 OK\r
667 250 Accepted\r
668 354 Enter message, ending with "." on a line by itself\r
669 550 reply_address=<>\r
670 250 OK\r
671 250 Accepted\r
672 354 Enter message, ending with "." on a line by itself\r
673 550 reply_address=<x@y>\r
674 221 myhost.test.ex closing connection\r
675
676 **** SMTP testing session as if from host V4NET.0.0.0
677 **** but without any ident (RFC 1413) callback.
678 **** This is not for real!
679
680 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
681 250 OK\r
682 250 Accepted\r
683 354 Enter message, ending with "." on a line by itself\r
684 550 reply_address=<>\r
685 221 myhost.test.ex closing connection\r
686
687 **** SMTP testing session as if from host V4NET.0.0.0
688 **** but without any ident (RFC 1413) callback.
689 **** This is not for real!
690
691 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
692 250 OK\r
693 250 Accepted\r
694 354 Enter message, ending with "." on a line by itself\r
695 550 reply_address=<>\r
696 221 myhost.test.ex closing connection\r
697 > match_ip:        15 
698 > match_ip:        16 
699