Refactor the res_search() fail hack
[users/jgh/exim.git] / test / stdout / 9000
1 > Expect "Hazel"
2 > ${lookup ldap {ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=Philip%20Hazel)}{$value}fail}
3 > Hazel
4
5 > DN is: cn=Philip Hazel,o=University of Cambridge,c=UK
6
7 > Expect "Hazel" (Unix socket interface)
8 > ${lookup ldap {ldapi://%2Ftmp%2Fldap.sock/o=University%20of%20Cambridge,c=UK?sn?sub?(cn=Philip%20Hazel)}{}fail}
9 > Hazel
10
11 > Expect syntax failure
12 > Failed: lookup of "X=y ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=Philip%20Hazel)" gave DEFER: unknown parameter "X=" precedes LDAP URL
13
14 > Expect "Hazel"
15 > ${lookup ldap {time=1 ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=Philip%20Hazel)}{$value}fail}
16 > Hazel
17
18 > Expect "manager" followed by "Hazel" 5 times
19 > ${lookup ldapm {ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{$value}fail}
20 > manager
21 Hazel
22 Hazel
23 Hazel
24 Hazel
25 Hazel
26
27 > DN is: cn=P*Hazel,o=University of Cambridge,c=UK
28
29 > Expect  "manager" followed by "Hazel"
30 > ${lookup ldapm {Size=2 ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{$value}fail}
31 > manager
32 Hazel
33
34 > Expect "manager" followed by "Hazel" 5 times
35 > ${lookup ldapm {ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{$value}fail}
36 > manager
37 Hazel
38 Hazel
39 Hazel
40 Hazel
41 Hazel
42
43 > Expect "manager"
44 > ${lookup ldap {size=1 ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{$value}fail}
45 > manager
46
47 > Expect too many results error
48 > Failed: lookup of "size=0 time=0 ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)" gave DEFER: LDAP search: more than one entry (6) was returned (filter not specific enough?)
49
50 > Expect "manager"
51 > ${lookup ldap {size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass=secret ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{$value}fail}
52 > manager
53
54 > Expect invalid credentials
55 > ${lookup ldap {size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass=known ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{$value}fail}
56 > Failed: lookup of "size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass=known ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)" gave DEFER: failed to bind the LDAP connection to server NULL:389 - LDAP error 49: Invalid credentials
57
58 > cn="Philip Hazel" sn=Hazel
59 > ${lookup ldap {ldap:///o=University%20of%20Cambridge,c=UK?sn,cn?sub?(cn=Philip%20Hazel)}{$value}fail}
60 > cn="Philip Hazel" sn="Hazel"
61
62 > cn="Philip Hazel" sn=Hazel objectClass=person
63 > ${lookup ldap {ldap:///o=University%20of%20Cambridge,c=UK??sub?(cn=Philip%20Hazel)}{$value}fail}
64 > cn="Philip Hazel" sn="Hazel" objectClass="person"
65
66 > P Hazel, Phil Hazel
67 > ${lookup ldapm {ldap:///o=University%20of%20Cambridge,c=UK?cn?sub?(cn=Phil%20Hazel)}{$value}fail}
68 > P Hazel, Phil Hazel
69 P Hazel, Phil Hazel
70
71 > cn="P Hazel" cn="Phil Hazel" sn=Hazel objectClass=person
72 > ${lookup ldapm {ldap:///o=University%20of%20Cambridge,c=UK??sub?(cn=Phil%20Hazel)}{$value}fail}
73 > cn="P Hazel, Phil Hazel" sn="Hazel" objectClass="person"
74 cn="P Hazel, Phil Hazel" sn="Hazel" objectClass="person"
75
76 > cn=P Hazel, o=University of Cambridge, c=UK
77 > ${lookup ldapdn {ldap:///o=University%20of%20Cambridge,c=UK??sub?(cn=manager)}{$value}fail}
78 > cn=manager,o=University of Cambridge,c=UK
79
80 > Expect too many results error
81 > Failed: lookup of "ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)" gave DEFER: LDAP search: more than one entry (6) was returned (filter not specific enough?)
82
83 > Expect "yes"
84 > ${if ldapauth {size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass=secret ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
85 > yes
86
87 > Expect "no"
88 > ${if ldapauth {size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass=known ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
89 > no
90
91 > Expect "no"
92 > ${if ldapauth {size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass= ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
93 > no
94
95 > Expect "no"
96 > ${if ldapauth {size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass=known ldaps://127.0.0.1/o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
97 > no
98
99 > Expect failure to contact server
100 > ${if ldapauth {size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass=known ldaps://127.0.0.1:9999/o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
101 > Failed: failed to bind the LDAP connection to server 127.0.0.1:9999 - ldap_bind() returned -1
102
103 > Expect "yes"
104 > ${if ldapauth { size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass=secret ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
105 > yes
106
107 > Expect "yes"
108 > ${if ldapauth { size=1 time=0 user=cn%3dmanager%2co%3DUniversity%20of%20Cambridge%2Cc%3dUK pass=secret ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
109 > yes
110
111 > Expect syntax error
112 > ${lookup ldap {ldapz:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=Philip%20Hazel)}{}fail}
113 > Failed: lookup of "ldapz:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=Philip%20Hazel)" gave DEFER: LDAP URL does not start with "ldap://", "ldaps://", or "ldapi://" (it starts with "ldapz:///o=Unive...")
114
115 > Expect error for missing user
116 > ${if ldapauth {size=1 time=0 pass=secret ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
117 > Failed: ldapauth lookups must specify the username and password
118
119 > Expect error for missing password
120 > ${if ldapauth {size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
121 > Failed: ldapauth lookups must specify the username and password
122
123 > Expect "no" because of empty password
124 > ${if ldapauth {size=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass="" ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
125 > no
126
127 > Expect "FAILED" because no such object
128 > ${lookup ldap {ldap:///o=JUNK}{}{FAILED}}
129 > FAILED
130
131 > Expect "P*Hazel (starry)"
132 > ${lookup ldap {ldap:///o=University%20of%20Cambridge,c=UK?cn?sub?(cn=P%5C2AHazel*)}{$value}fail}
133 > P*Hazel
134
135 > DN is: cn=P*Hazel,o=University of Cambridge,c=UK
136
137 > Expect "P,Hazel"
138 > ${lookup ldap {ldap:///cn=P%5C%2CHazel,o=University%20of%20Cambridge,c=UK?cn?sub?(cn=*)}{$value}fail}
139 > P,Hazel
140
141 > Expect syntax error
142 > ${if ldapauth { soze=1 time=0 user="cn=manager,o=University of Cambridge,c=UK" pass=secret ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
143 > Failed: unknown parameter "soze=" precedes LDAP URL
144
145 > Expect syntax error
146 > ${if ldapauth { size=1 time=0 user"cn=manager,o=University of Cambridge,c=UK" pass=secret ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=*)}{yes}{no}}
147 > Failed: unknown parameter "user"cn=" precedes LDAP URL
148
149 > Expect 5 x "Hazel"
150 > Hazel
151 > Hazel
152 > Hazel
153 > Hazel
154 > Hazel
155
156 > Expect 2 x "Hazel" (using ldaps)
157 > ${lookup ldap {user="cn=manager,o=University of Cambridge,c=UK" pass=secret ldaps://127.0.0.1/o=University%20of%20Cambridge,c=UK?sn?sub?(cn=Philip%20Hazel)}{}fail}
158 > Hazel
159 > Hazel
160
161 > Expect 2 x "Hazel"
162 > Hazel
163 > Hazel
164
165 > Expect 3 x "Hazel"
166 > Hazel
167 > Hazel
168 > Hazel
169
170 > Expect errors
171 > ${lookup ldap {ldapi://127.0.0.1/o=University%20of%20Cambridge,c=UK?sn?sub?(cn=Philip%20Hazel)}{}fail}
172 > Failed: lookup of "ldapi://127.0.0.1/o=University%20of%20Cambridge,c=UK?sn?sub?(cn=Philip%20Hazel)" gave DEFER: ldapi requires an absolute path ("127.0.0.1" given)
173
174 > ${lookup ldap {user="cn=manager,o=University of Cambridge,c=UK" pass="se"cret" ldaps://127.0.0.1/o=University%20of%20Cambridge,c=UK?sn?sub?(cn=Philip%20Hazel)}{}fail}
175 > Failed: lookup of "user="cn=manager,o=University of Cambridge,c=UK" pass="se\"cret" ldaps://127.0.0.1/o=University%20of%20Cambridge,c=UK?sn?sub?(cn=Philip%20Hazel)" gave DEFER: failed to bind the LDAP connection to server 127.0.0.1:636 - LDAP error 49: Invalid credentials
176
177 > Expect ldap_search to fail
178 > Failed: lookup of "ldap:///o=top?mailRoutingAddress,mailHost,objectClass?sub?(&(mailLocalAddress=3-1546081-domain.net?wendling@stderr.efficientimpacte.com)(objectClass=inetLocalMailRecipient))" gave DEFER: ldap_search failed: -7, Bad search filter
179
180 > Expect "Hazel" - checking referrals syntax
181 > ${lookup ldap {time=1 referrals=nofollow ldap:///o=University%20of%20Cambridge,c=UK?sn?sub?(cn=Philip%20Hazel)}{$value}fail}
182 > Hazel
183