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