File: blitirispf-tests.yml

package info (click to toggle)
golang-blitiri-go-spf 1.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 3,524 kB
  • sloc: makefile: 3
file content (312 lines) | stat: -rw-r--r-- 7,977 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# Simple tests, used for debugging the testing infrastructure; and some
# additional tests for situations not covered by the other files.

---
description: Simple successes
tests:
  test1:
    description: Straightforward sucesss
    helo: example.net
    mailfrom: "foobar@example.net"
    host: 1.2.3.4
    result: pass
  test2:
    description: HELO is set, but expected to be ignored
    helo: blargh
    mailfrom: "foobar@example.net"
    host: 1.2.3.4
    result: pass
zonedata:
  example.net:
    - SPF:  v=spf1 +all
---
description: Simple failures
tests:
  test1:
    description: Straightforward failure
    helo: example.net
    mailfrom: "foobar@example.net"
    host: 1.2.3.4
    result: fail
  test2:
    description: HELO is set, but expected to be ignored
    helo: blargh
    mailfrom: "foobar@example.net"
    host: 1.2.3.4
    result: fail
zonedata:
  example.net:
    - SPF:  v=spf1 -all
---
description: Regexp edge cases for "a", "mx" and "ptr"
tests:
  ipv6-with-a:
    description: |
      Send from an ip6 address that has "a:" inside. If we incorrectly parse
      the "ip6" as "a", this results in a permerror since the host doesn't
      match.
    mailfrom: "foobar@a1.net"
    host: a::a
    result: pass
  bad-a-mask:
    description: |
      If we incorrectly parse the "ip6" as "a", this results in a permerror
      due to an invalid mask.
    mailfrom: "foobar@a2.net"
    host: 2001:db8:ff0:100::2
    result: softfail
  exp-contains-mx:
    description: exp= contains mx:, which should be ignored.
    mailfrom: "foobar@expmx.net"
    host: 1.2.3.4
    result: softfail
  exp-contains-ptr:
    description: |
      exp= contains ptr:, which should be ignored.
      Note this test case involves unusual/invalid domains.
    mailfrom: "foobar@expptr.net"
    host: 1.2.3.4
    result: softfail
zonedata:
  a1.net:
    - SPF: v=spf1 ip6:a::a ~all
  a2.net:
    - SPF: v=spf1 ip6:1a0a:cccc::/29 ~all
  expmx.net:
    - SPF: v=spf1 exp=mx:mymx.com ~all
    - MX: [10, mymx.com]
  mymx.com:
    - A: 1.2.3.4
  expptr.net:
    - SPF: v=spf1 exp=ptr:lalala.com ~all
  4.3.2.1.in-addr.arpa:
    - PTR: ptr:lalala.com.
  ptr:lalala.com:
    - A: 1.2.3.4
---
description: Error on PTR forward resolution
tests:
  broken-ptr-forward:
    description: |
      Check that if during 'ptr' forward resolution we get an error, we skip
      the domain (and consequently fail the check).
    mailfrom: "foo@domain.net"
    host: 1.2.3.4
    result: softfail
zonedata:
  domain.net:
    - SPF: v=spf1 ptr:lalala.com ~all
  4.3.2.1.in-addr.arpa:
    - PTR: lalala.com
  lalala.com:
    - TIMEOUT: true
---
description: Permanent error on 'exists' resolution
tests:
  exists-perm-error:
    description: |
      Check that if, during an 'exists' forward resolution we get an error, we
      return temperror.
    mailfrom: "foo@domain.net"
    host: 1.2.3.4
    result: temperror
zonedata:
  domain.net:
    - SPF: v=spf1 exists:lalala.com ~all
  lalala.com:
    - SERVFAIL: true
---
description: Resolve H macros correctly
tests:
  resolve-h-macros:
    description: |
      Check that '%{h}' macros are correctly resolved to the HELO/EHLO and not
      the sender domain.
    mailfrom: "foo@domain.net"
    helo: holahola
    host: 1.2.3.4
    result: pass
zonedata:
  domain.net:
    - SPF: v=spf1 exists:%{h}.com ~all
  holahola.com:
    - A: 127.0.0.2
---
description: Only include the first 10 PTR results
tests:
  only-first-10-ptr:
    description: |
      Check that if during 'ptr' forward resolution we only consider the first
      10 names, and ignore the rest.
    mailfrom: "foo@domain.net"
    host: 1.2.3.4
    result: softfail
zonedata:
  domain.net:
    - A: 127.0.0.1
    - SPF: v=spf1 ptr ~all
  4.3.2.1.in-addr.arpa:
    - PTR: dom01.com
    - PTR: dom02.com
    - PTR: dom03.com
    - PTR: dom04.com
    - PTR: dom05.com
    - PTR: dom06.com
    - PTR: dom07.com
    - PTR: dom08.com
    - PTR: dom09.com
    - PTR: dom10.com
    # Entries below here should get dropped. They would make it pass.
    - PTR: domain.net
  dom01.com:
    - A: 127.0.0.1
  dom02.com:
    - A: 127.0.0.2
  dom03.com:
    - A: 127.0.0.3
  dom04.com:
    - A: 127.0.0.4
  dom05.com:
    - A: 127.0.0.5
  dom06.com:
    - A: 127.0.0.6
  dom07.com:
    - A: 127.0.0.7
  dom08.com:
    - A: 127.0.0.8
  dom09.com:
    - A: 127.0.0.9
  dom10.com:
    - A: 127.0.0.10
---
description: Resolution limits
tests:
  resolution-with-10-lookups:
    description: |
      Check that a resolution with precisely 10 lookups (the default limit)
      works fine.
    mailfrom: "foo@okay.com"
    host: 1.2.3.4
    result: pass
  resolution-with-11-lookups:
    description: |
      Check that a resolution with precisely 11 lookups (over default limit)
      fails as expected.
    mailfrom: "foo@bad.com"
    host: 1.2.3.4
    result: permerror
zonedata:
  okay.com:
    - SPF: v=spf1 include:d11 include:d12 include:d13
                  include:d14 include:d15 -all
  bad.com:
    - SPF: v=spf1 include:d00
                  include:d11 include:d12 include:d13
                  include:d14 include:d15 -all
  d00:
    - SPF: v=spf1 -all
  d11:
    - SPF: v=spf1 include:d21 ~all
  d12:
    - SPF: v=spf1 include:d22 ~all
  d13:
    - SPF: v=spf1 include:d23 ~all
  d14:
    - SPF: v=spf1 include:d24 ~all
  d15:
    - SPF: v=spf1 include:d25 ~all
  d21:
    - SPF: v=spf1 -all
  d22:
    - SPF: v=spf1 -all
  d23:
    - SPF: v=spf1 -all
  d24:
    - SPF: v=spf1 -all
  d25:
    - SPF: v=spf1 all
---
description: MX resolution limits
tests:
  mx-resolution-10-terms:
    description: |
      Check that a resolution with 10 "mx" terms works, because it's within
      the limit. Each term will resolve to multiple records, but those
      shouldn't be individually counted (there's a limit of 10 MX records per
      MX lookup, but that's tested separately).
    mailfrom: "foo@mx10"
    host: 1.2.3.4
    result: pass
  mx-resolution-11-terms:
    description: |
      Check that a resolution with 11 "mx" terms, causes a permerror due to
      exceeding lookup limits.
    mailfrom: "foo@mx11"
    host: 1.2.3.4
    result: permerror
zonedata:
  mx10:
    - SPF: v=spf1 mx:domain mx:domain mx:domain mx:domain mx:domain
                  mx:domain mx:domain mx:domain mx:domain mx:domain
                  all
  mx11:
    - SPF: v=spf1 mx:domain mx:domain mx:domain mx:domain mx:domain
                  mx:domain mx:domain mx:domain mx:domain mx:domain
                  mx:domain all
  domain:
    - MX: [1, blah1]
    - MX: [2, blah2]
    - MX: [3, blah3]
---
description: NXDOMAIN tests
tests:
  one-mx-not-found:
    description: |
      Check that if one of the MXs is not found, we continue evaluating the
      rest.
    mailfrom: "foo@d00"
    host: 1.2.3.4
    result: pass
  all-mx-not-found:
    description: |
      Check that if none of the MXs is not found, we continue evaluating the
      rest of the terms.
    mailfrom: "foo@d01"
    host: 1.2.3.4
    result: pass
  domain-not-found:
    description: |
      Check if the top-level domain is not found (which is different that it
      existing but having no TXT record).
    mailfrom: "foo@doesnotexist"
    host: 1.2.3.4
    result: none
  include-not-found:
    description: |
      For include, if the recursive check returns None, it should make the
      evaluation return PermError.
    mailfrom: "foo@d02"
    host: 1.2.3.4
    result: permerror
  redirect-not-found:
    description: |
      For redirect, if the recursive check returns None, it should make the
      evaluation return PermError.
    mailfrom: "foo@d03"
    host: 1.2.3.4
    result: permerror
zonedata:
  d00:
    - SPF: v=spf1 mx -all
    - MX: [10, "doesnotexist"]
    - MX: [20, "sender"]
  d01:
    - SPF: v=spf1 mx ip4:1.2.3.4 -all
    - MX: [10, "doesnotexist"]
    - MX: [20, "doesnotexist"]
  d02:
    - SPF: v=spf1 include:doesnotexist all
  d03:
    - SPF: v=spf1 redirect=doesnotexist
  sender:
    - A: 1.2.3.4