blob: 2da6c67f93abd965d87cbd3b53b2f65f06ab9787 [file] [log] [blame]
# PySPF test suite
# $Id$
# vim:sw=2 sts=2
#
# This is the test suite used during development of the pyspf library.
# It is a collection of ad hoc tests based on bug reports. It is the
# goal of the SPF test project to have an elegant and minimal test suite
# that reflects RFC 4408. However, this should help get things started
# by serving as a example of what tests look like. Also, any implementation
# that flunks this, should flunk the minimal elegant suite as well.
#
# 17/07/2006 from http://www.openspf.org/svn/project/test-suite/pyspf-tests.yml
---
description: Check basic exists with macros
tests:
exists-pass:
helo: mail.example.net
host: 1.2.3.5
mailfrom: lyme.eater@example.co.uk
result: pass
exists-fail:
helo: mail.example.net
host: 1.2.3.4
mailfrom: lyme.eater@example.co.uk
result: fail
zonedata:
lyme.eater.example.co.uk.1.2.3.5.spf.example.net:
- A: 127.0.0.1
example.co.uk:
- SPF: v=spf1 mx/26 exists:%{l}.%{d}.%{i}.spf.example.net -all
---
description: Permerror detection
tests:
incloop:
description: Include loop
helo: mail.example.com
host: 66.150.186.79
mailfrom: chuckvsr@examplea.com
result: permerror
badall:
helo: mail.example.com
host: 66.150.186.79
mailfrom: chuckvsr@examplec.com
result: permerror
baddomain:
helo: mail.example.com
host: 66.150.186.79
mailfrom: chuckvsr@exampled.com
result: permerror
badip:
helo: mail.example.com
host: 66.150.186.79
mailfrom: chuckvsr@examplee.com
result: permerror
zonedata:
examplea.com:
- SPF: v=spf1 a mx include:b.com
exampleb.com:
- SPF: v=spf1 a mx include:a.com
examplec.com:
- SPF: v=spf1 -all:foobar
exampled.com:
- SPF: v=spf1 a:examplea.com:8080
examplee.com:
- SPF: v=spf1 ip4:1.2.3.4:8080
---
tests:
nospace1:
description: Test no space, test multi-line comment
helo: mail.example1.com
host: 1.2.3.4
mailfrom: foo@example2.com
result: none
empty:
description: Test empty
helo: mail1.example1.com
host: 1.2.3.4
mailfrom: foo@example1.com
result: neutral
nospace2:
helo: mail.example1.com
host: 1.2.3.4
mailfrom: foo@example3.com
result: pass
zonedata:
example3.com:
- SPF: v=spf1mx
- SPF: v=spf1 mx
- MX: [0, mail.example1.com]
example1.com:
- SPF: v=spf1
example2.com:
- SPF: v=spf1mx
mail.example1.com:
- A: 1.2.3.4
---
description: Check trailing dot with redirect and exp
tests:
traildot1:
spec: 8.1
description: Trailing dot must be accepted for domains.
helo: msgbas2x.cos.example.com
host: 192.168.218.40
mailfrom: test@example.com
result: pass
traildot2:
spec: 8.1
description: Trailing dot must not be removed from explanation.
helo: msgbas2x.cos.example.com
host: 192.168.218.40
mailfrom: test@exp.example.com
result: fail
explanation: This is a test.
zonedata:
example.com.d.spf.example.com:
- SPF: v=spf1 redirect=a.spf.example.com
a.spf.example.com:
- SPF: >-
v=spf1 mx:example.com include:o.spf.example.com -exists:%{s}.S.bl.spf.example.com
exists:%{s}.S.%{i}.AI.spf.example.com ~all
o.spf.example.com:
- SPF: v=spf1 ip4:192.168.144.41 ip4:192.168.218.40 ip4:192.168.218.41
msgbas1x.cos.example.com:
- A: 192.168.240.36
example.com:
- A: 192.168.90.76
- SPF: v=spf1 redirect=%{d}.d.spf.example.com.
- MX: [10, msgbas1x.cos.example.com]
exp.example.com:
- SPF: v=spf1 exp=msg.example.com. -all
msg.example.com:
- TXT: This is a test.
---
description: Corner cases
tests:
emptyMX:
description: Test empty MX
helo: mail.example.com
host: 1.2.3.4
mailfrom: ""
result: neutral
localhost:
helo: mail.example.com
host: 127.0.0.1
mailfrom: root@example.com
result: fail
zonedata:
mail.example.com:
- MX: [0, ""]
- SPF: v=spf1 mx
example.com:
- SPF: v=spf1 -all