git » spf » next » tree

[next] / testdata / blitirispf-tests.yml

   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
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
# 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: Lookup limit boundary
tests:
  lookup-limit-at-10:
    description: |
      Check that a resolution with exactly 10 terms that cause DNS lookups is
      allowed, and that the terms after them are still evaluated.
    mailfrom: "foo@at10"
    host: 1.2.3.4
    result: pass
  lookup-limit-at-10-matches:
    description: |
      Check that the 10th term that causes a DNS lookup is evaluated, and can
      produce a match. It is the last term, so nothing after it can alter the
      result.
    mailfrom: "foo@at10match"
    host: 1.2.3.4
    result: pass
  lookup-limit-over-a:
    description: |
      Check that the 11th "a" term is not evaluated, even though it would
      match. The limit must be checked before doing the lookup: checking it
      only when moving on to the next term allows 11 lookups instead of 10,
      and lets the 11th one decide the result.
    mailfrom: "foo@over-a"
    host: 1.2.3.4
    result: permerror
  lookup-limit-over-mx:
    description: |
      Same as lookup-limit-over-a, for the "mx" mechanism.
    mailfrom: "foo@over-mx"
    host: 1.2.3.4
    result: permerror
  lookup-limit-over-exists:
    description: |
      Same as lookup-limit-over-a, for the "exists" mechanism.
    mailfrom: "foo@over-exists"
    host: 1.2.3.4
    result: permerror
  lookup-limit-over-ptr:
    description: |
      Same as lookup-limit-over-a, for the "ptr" mechanism.
    mailfrom: "foo@over-ptr"
    host: 1.2.3.4
    result: permerror
  lookup-limit-over-no-match:
    description: |
      Check that the 11th term causes a permerror even when it does not match
      and there is no term after it. Otherwise the record is evaluated to the
      end, and the excess lookup goes unnoticed.
    mailfrom: "foo@over-nomatch"
    host: 1.2.3.4
    result: permerror
zonedata:
  at10:
    - SPF: v=spf1 a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  ip4:1.2.3.4 -all
  at10match:
    - SPF: v=spf1 a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  a:nomatch a:nomatch a:nomatch a:nomatch
                  a:amatch
  over-a:
    - SPF: v=spf1 a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  a:amatch
  over-mx:
    - SPF: v=spf1 a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  mx:mxmatch
  over-exists:
    - SPF: v=spf1 a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  exists:amatch
  over-ptr:
    - SPF: v=spf1 a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  ptr:ptrmatch.com
  over-nomatch:
    - SPF: v=spf1 a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  a:nomatch
  nomatch:
    - A: 10.0.0.1
  amatch:
    - A: 1.2.3.4
  mxmatch:
    - MX: [10, amatch]
  ptrmatch.com:
    - A: 1.2.3.4
  4.3.2.1.in-addr.arpa:
    - PTR: ptrmatch.com
---
description: Void lookup limit
tests:
  void-limit-at-2:
    description: |
      Check that 2 void lookups (the default limit) are allowed, and that the
      terms after them are still evaluated.
    mailfrom: "foo@atvoid2"
    host: 1.2.3.4
    result: pass
  void-limit-over-a:
    description: |
      Check that exceeding the void lookup limit on an "a" term causes a
      permerror, even when it is the last term. The limit must be checked
      right after the lookup: checking it only when moving on to the next
      term lets the excess go unnoticed if there is no next term.
    mailfrom: "foo@overvoid-a"
    host: 1.2.3.4
    result: permerror
  void-limit-over-mx:
    description: |
      Same as void-limit-over-a, for the "mx" mechanism. The domain exists but
      has no MX records, which is a void lookup.
    mailfrom: "foo@overvoid-mx"
    host: 1.2.3.4
    result: permerror
  void-limit-over-exists:
    description: |
      Same as void-limit-over-a, for the "exists" mechanism.
    mailfrom: "foo@overvoid-exists"
    host: 1.2.3.4
    result: permerror
  void-limit-over-ptr:
    description: |
      Same as void-limit-over-a, for the "ptr" mechanism. The address has no
      PTR records, which is a void lookup.
    mailfrom: "foo@overvoid-ptr"
    host: 1.2.3.4
    result: permerror
  void-limit-over-in-include:
    description: |
      Check that exceeding the void lookup limit inside an "include" makes the
      whole evaluation return permerror, instead of just making the include
      not match. Note the include is the last term, so nothing after it can
      turn the excess into a permerror on its own.
    mailfrom: "foo@overvoid-include"
    host: 1.2.3.4
    result: permerror
zonedata:
  atvoid2:
    - SPF: v=spf1 a:void1 a:void2 ip4:1.2.3.4 -all
  overvoid-a:
    - SPF: v=spf1 a:void1 a:void2 a:void3
  overvoid-mx:
    - SPF: v=spf1 a:void1 a:void2 mx:onlya
  overvoid-exists:
    - SPF: v=spf1 a:void1 a:void2 exists:void3
  overvoid-ptr:
    - SPF: v=spf1 a:void1 a:void2 ptr
  overvoid-include:
    - SPF: v=spf1 include:overvoid-a
  onlya:
    - A: 1.2.3.4
---
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: PTR resolution limits
tests:
  ptr-resolution-10-terms:
    description: |
      Check that a resolution with 10 "ptr" terms works, because it's within
      the limit, and that the terms after them are still evaluated. The
      address is only resolved once and the names reused, but each term still
      counts against the limit.
    mailfrom: "foo@ptr10"
    host: 1.2.3.4
    result: pass
  ptr-resolution-11-terms:
    description: |
      Check that a resolution with 11 "ptr" terms causes a permerror due to
      exceeding lookup limits, even though only one DNS lookup is performed.
    mailfrom: "foo@ptr11"
    host: 1.2.3.4
    result: permerror
  ptr-resolution-mixed-terms:
    description: |
      Check that "ptr" terms are counted individually when mixed with other
      terms that cause DNS lookups: here the second "ptr" is the 11th term,
      and takes the resolution over the limit.
    mailfrom: "foo@ptrmixed"
    host: 1.2.3.4
    result: permerror
zonedata:
  ptr10:
    - SPF: v=spf1 ptr:nomatch.com ptr:nomatch.com ptr:nomatch.com
                  ptr:nomatch.com ptr:nomatch.com ptr:nomatch.com
                  ptr:nomatch.com ptr:nomatch.com ptr:nomatch.com
                  ptr:nomatch.com ip4:1.2.3.4 -all
  ptr11:
    - SPF: v=spf1 ptr:nomatch.com ptr:nomatch.com ptr:nomatch.com
                  ptr:nomatch.com ptr:nomatch.com ptr:nomatch.com
                  ptr:nomatch.com ptr:nomatch.com ptr:nomatch.com
                  ptr:nomatch.com ptr:nomatch.com -all
  ptrmixed:
    - SPF: v=spf1 a:nomatch a:nomatch a:nomatch a:nomatch a:nomatch
                  a:nomatch a:nomatch a:nomatch a:nomatch
                  ptr:nomatch.com ptr:nomatch.com -all
  nomatch:
    - A: 10.0.0.1
  ptrhost.com:
    - A: 1.2.3.4
  4.3.2.1.in-addr.arpa:
    - PTR: ptrhost.com
---
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
---
description: PTR forward confirmation
tests:
  ptr-forward-confirmed:
    description: |
      A PTR name that resolves back to the IP being checked is validated, and
      matches.
    mailfrom: "foo@good.com"
    host: 1.2.3.4
    result: pass
  ptr-resolves-elsewhere:
    description: |
      A PTR name that resolves, but to a different address, must NOT be
      validated: RFC 7208 section 5.5 requires <ip> to be among the addresses
      returned for the name, not just that the name resolves to something.
    mailfrom: "foo@bad.com"
    host: 1.2.3.4
    result: fail
  ptr-resolves-elsewhere-v6:
    description: |
      As above, but the name resolves to an address of a different family.
    mailfrom: "foo@badv6.com"
    host: 1.2.3.4
    result: fail
  ptr-one-of-many:
    description: |
      A name with several addresses is validated if any one of them is the IP
      being checked.
    mailfrom: "foo@many.com"
    host: 1.2.3.4
    result: pass
zonedata:
  good.com:
    - SPF: v=spf1 ptr:good.com -all
    - A: 1.2.3.4
  bad.com:
    - SPF: v=spf1 ptr:bad.com -all
    - A: 9.9.9.9
  badv6.com:
    - SPF: v=spf1 ptr:badv6.com -all
    - AAAA: 2001:db8::1
  many.com:
    - SPF: v=spf1 ptr:many.com -all
    - A: 10.0.0.1
    - A: 1.2.3.4
    - A: 10.0.0.2
  4.3.2.1.in-addr.arpa:
    - PTR: good.com
    - PTR: bad.com
    - PTR: badv6.com
    - PTR: many.com
---
description: PTR domain matching
tests:
  ptr-exact:
    description: |
      The validated name is the target domain itself, so it matches.
    mailfrom: "foo@exact.com"
    host: 1.2.3.4
    result: pass
  ptr-subdomain:
    description: |
      The validated name is a subdomain of the target domain, so it matches.
    mailfrom: "foo@sub.com"
    host: 1.2.3.5
    result: pass
  ptr-not-subdomain:
    description: |
      The validated name ends with the target domain as a string, but not at
      a label boundary, so it must NOT match: RFC 7208 section 5.5 requires
      the name to be the target domain, or a subdomain of it.
    mailfrom: "foo@notsub.com"
    host: 1.2.3.6
    result: fail
  ptr-target-trailing-dot:
    description: |
      A target domain written with a trailing dot matches the same names as
      one written without it.
    mailfrom: "foo@dot.com"
    host: 1.2.3.7
    result: pass
zonedata:
  exact.com:
    - SPF: v=spf1 ptr:exactname.com -all
  exactname.com:
    - A: 1.2.3.4
  4.3.2.1.in-addr.arpa:
    - PTR: exactname.com

  sub.com:
    - SPF: v=spf1 ptr:subname.com -all
  deep.sub.subname.com:
    - A: 1.2.3.5
  5.3.2.1.in-addr.arpa:
    - PTR: deep.sub.subname.com

  notsub.com:
    - SPF: v=spf1 ptr:example.com -all
  notexample.com:
    - A: 1.2.3.6
  6.3.2.1.in-addr.arpa:
    - PTR: notexample.com

  dot.com:
    - SPF: v=spf1 ptr:dotname.com. -all
  dotname.com:
    - A: 1.2.3.7
  7.3.2.1.in-addr.arpa:
    - PTR: dotname.com
---
description: Macro context in recursive evaluations
tests:
  include-macro-d:
    description: |
      The %{d} macro inside an included record expands to the included
      domain, not the original one: RFC 7208 section 5.2 says check_host()
      is evaluated with the include's target as <domain>, and section 7.2
      defines d = <domain>.
      If %{d} was (incorrectly) expanded to the original domain, the exists
      would not match, and the check would fail.
    spec: 5.2/3, 7.2
    mailfrom: "foo@senderd.net"
    host: 1.2.3.4
    result: pass
  include-macro-sender:
    description: |
      The %{l} and %{o} macros inside an included record still refer to the
      original <sender>: RFC 7208 section 5.2 says the <sender> argument
      remains the same in the recursive evaluation, and section 7.3 notes
      that %{s}, %{l} and %{o} remain the same during recursive and chained
      evaluations.
      If they were (incorrectly) taken from the included domain, the exists
      would not match, and the check would fail.
    spec: 5.2/3, 7.3/23
    mailfrom: "foo@senders.net"
    host: 1.2.3.4
    result: pass
  redirect-macro-d:
    description: |
      Like include-macro-d, but for "redirect": RFC 7208 section 6.1 says
      check_host() is evaluated with the redirect target as <domain>.
    spec: 6.1/3, 7.2
    mailfrom: "foo@rsenderd.net"
    host: 1.2.3.4
    result: pass
  redirect-macro-sender:
    description: |
      Like include-macro-sender, but for "redirect": RFC 7208 section 6.1
      says the <sender> argument remains the same after a redirect.
    spec: 6.1/3, 7.3/23
    mailfrom: "foo@rsenders.net"
    host: 1.2.3.4
    result: pass
zonedata:
  senderd.net:
    - SPF: v=spf1 include:incd.net -all
  incd.net:
    - SPF: v=spf1 exists:d.%{d} -all
  d.incd.net:
    - A: 127.0.0.2

  senders.net:
    - SPF: v=spf1 include:incs.net -all
  incs.net:
    - SPF: v=spf1 exists:%{l}.%{o}.sendermacro.net -all
  foo.senders.net.sendermacro.net:
    - A: 127.0.0.2

  rsenderd.net:
    - SPF: v=spf1 redirect=rincd.net
  rincd.net:
    - SPF: v=spf1 exists:d.%{d} -all
  d.rincd.net:
    - A: 127.0.0.2

  rsenders.net:
    - SPF: v=spf1 redirect=rincs.net
  rincs.net:
    - SPF: v=spf1 exists:%{l}.%{o}.rsendermacro.net -all
  foo.rsenders.net.rsendermacro.net:
    - A: 127.0.0.2
---
description: Case-insensitivity of mechanism, modifier, and version names
tests:
  upper-version:
    description: |
      The version section is case-insensitive: RFC 7208 section 12 says
      literal text strings in the ABNF are case-insensitive, and the record
      grammar defines version = "v=spf1".
    spec: 4.5/3, 12/2
    mailfrom: "foo@verup.net"
    host: 1.2.3.4
    result: fail
  upper-ip4-all:
    description: |
      Mechanism names are case-insensitive: RFC 7208 section 12 says "mx"
      matches "mx", "MX", "mX" and "Mx"; the same applies to every
      mechanism name.
    spec: 4.6.1/9, 12/2
    mailfrom: "foo@ip4up.net"
    host: 1.2.3.4
    result: pass
  upper-all:
    description: |
      "ALL" with a qualifier is the "all" mechanism.
    spec: 4.6.1/9, 12/2
    mailfrom: "foo@allup.net"
    host: 1.2.3.4
    result: softfail
  upper-a:
    description: |
      A bare uppercase "A" is the "a" mechanism.
    spec: 4.6.1/9, 12/2
    mailfrom: "foo@aup.net"
    host: 1.2.3.4
    result: pass
  upper-mx:
    description: |
      A bare uppercase "MX" is the "mx" mechanism.
    spec: 4.6.1/9, 12/2
    mailfrom: "foo@mxup.net"
    host: 1.2.3.4
    result: pass
  upper-include-exists:
    description: |
      Uppercase "INCLUDE:" and "EXISTS:" (with their domain argument) work
      like their lowercase versions.
    spec: 4.6.1/9, 12/2
    mailfrom: "foo@incup.net"
    host: 1.2.3.4
    result: pass
  upper-ptr:
    description: |
      A bare uppercase "PTR" is the "ptr" mechanism.
    spec: 4.6.1/9, 12/2
    mailfrom: "foo@ptrup.net"
    host: 1.2.3.4
    result: pass
  upper-redirect:
    description: |
      Modifier names are case-insensitive too: "REDIRECT=" is the
      "redirect" modifier, not an unknown modifier to be ignored.
    spec: 4.6.1/9, 12/2
    mailfrom: "foo@redirup.net"
    host: 1.2.3.4
    result: pass
  redirect-mixed-case-duplicate:
    description: |
      Duplicate modifier detection must be case-insensitive as well:
      "redirect" appearing twice is a permerror (RFC 7208 section 6), even
      if spelled with different case each time.
    spec: 6/2, 12/2
    mailfrom: "foo@redirdup.net"
    host: 1.2.3.4
    result: permerror
zonedata:
  verup.net:
    - SPF: V=SPF1 -ALL
  ip4up.net:
    - SPF: v=spf1 IP4:1.2.3.4 -ALL
  allup.net:
    - SPF: v=spf1 ~ALL
  aup.net:
    - SPF: v=spf1 A -all
    - A: 1.2.3.4
  mxup.net:
    - SPF: v=spf1 MX -all
    - MX: [10, mxhost.mxup.net]
  mxhost.mxup.net:
    - A: 1.2.3.4
  incup.net:
    - SPF: v=spf1 INCLUDE:incup2.net -all
  incup2.net:
    - SPF: v=spf1 EXISTS:existup.net -all
  existup.net:
    - A: 127.0.0.2
  ptrup.net:
    - SPF: v=spf1 PTR -all
    - A: 1.2.3.4
  4.3.2.1.in-addr.arpa:
    - PTR: ptrup.net
  redirup.net:
    - SPF: v=spf1 REDIRECT=redirtarget.net
  redirdup.net:
    - SPF: v=spf1 redirect=redirtarget.net ReDirEct=redirtarget.net
  redirtarget.net:
    - SPF: v=spf1 ip4:1.2.3.4 -all
---
description: Macro expansion details
tests:
  macro-digit-exceeds-parts:
    description: |
      RFC 7208 section 7.3: if the DIGIT transformer specifies more parts
      than are available, all the available parts are used; and
      implementations MUST support a DIGIT value of at least 127.
    spec: 7.3/20
    mailfrom: "foo@macrod.net"
    host: 1.2.3.4
    result: pass
  macro-digit-zero:
    description: |
      RFC 7208 section 7.3: if a DIGIT is specified, the value MUST be
      nonzero; a zero value is a syntax error.
    spec: 7.3/20
    mailfrom: "foo@zerod.net"
    host: 1.2.3.4
    result: permerror
  macro-v-ip4:
    description: |
      The %{v} macro expands to "in-addr" for IPv4 connections.
      The existing rfc7208-tests.yml tests for %{v} only observe it through
      the explanation string, which our test runner ignores; this one is
      observable through the result.
    spec: 7.2/3
    mailfrom: "foo@macrov.net"
    host: 1.2.3.4
    result: pass
  macro-v-ip6:
    description: |
      The %{v} macro expands to "ip6" for IPv6 connections, and %{ir}
      expands to the reversed dot-format (nibble) address. This is the
      expansion example from RFC 7208 section 7.4.
    spec: 7.2/3, 7.3/21, 7.4
    mailfrom: "foo@macrov.net"
    host: 2001:db8::cb01
    result: pass
  macro-upper-escape:
    description: |
      Uppercase macros expand as their lowercase equivalents and are then
      URL escaped; characters not in the "unreserved" set MUST be escaped.
      Here %{S} expands the sender and escapes the "@" as "%40".
      The existing test for this (upper-macro) only observes it through the
      explanation string, which our test runner ignores.
    spec: 7.3/26
    mailfrom: "bar@escape.net"
    host: 1.2.3.4
    result: pass
  macro-p-unknown:
    description: |
      RFC 7208 section 7.3: if there are no validated domain names for the
      %{p} macro (here, <ip> has no PTR records), the string "unknown" is
      used.
    comment: |
      We always expand %{p} to "unknown" without doing the PTR lookup, which
      happens to be the RFC-mandated result for this test. Note that the
      RFC also says the lookup counts against the processing limits
      (section 4.6.4), which we consequently don't do; that is not tested
      here.
    spec: 7.3/22
    mailfrom: "foo@pmacro.net"
    host: 1.2.3.4
    result: pass
  macro-postmaster-empty-local:
    description: |
      RFC 7208 section 4.3: if the <sender> has no local-part, the string
      "postmaster" is substituted for the local-part; %{l} must then expand
      to "postmaster".
      The existing test for this (nolocalpart) only observes it through the
      explanation string, which our test runner ignores.
    spec: 4.3/2, 7.3/23
    mailfrom: "@nolocal.net"
    host: 1.2.3.4
    result: pass
    skip: We don't substitute "postmaster" for an empty local-part.
  macro-postmaster-null-sender:
    description: |
      Like macro-postmaster-empty-local, but with a completely null sender:
      per RFC 7208 section 2.4, the "MAIL FROM" identity is then taken to
      be postmaster@<HELO identity>, so %{l} must expand to "postmaster".
    spec: 2.4/2, 4.3/2
    helo: hel.nullsender.net
    mailfrom: ""
    host: 1.2.3.4
    result: pass
    skip: We don't substitute "postmaster" for an empty local-part.
  macro-empty-parts:
    description: |
      RFC 7208 section 7.3: no special treatment is given to consecutive
      delimiters in macro values, so the list of parts might contain empty
      strings, which are then rejoined with dots. A local-part of "a..b"
      must therefore expand (via %{l}) to "a..b", not "a.b".
      The expanded name has an empty label, which cannot be queried; per
      section 4.8 handling of such domains is undefined (no-match and
      permerror are both acceptable), but expanding to "a.b" and matching
      is not.
    spec: 7.3/17, 4.8/5
    mailfrom: "a..b@empties.net"
    host: 1.2.3.4
    result: [fail, permerror]
    skip: We drop empty parts when splitting macro values, giving pass here.
  macro-truncation:
    description: |
      RFC 7208 section 7.3: when the result of macro expansion is used in a
      domain name query and exceeds 253 characters, the left side is
      truncated to fit, by removing successive domain labels (and their
      following dots) until the total length does not exceed 253
      characters.
      Here %{h} is a 255-character name; after appending ".trunc.net" the
      first label has to be removed, and the resulting 201-character name
      does exist.
    spec: 7.3/25
    helo: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
    mailfrom: "foo@trunc.net"
    host: 1.2.3.4
    result: pass
    skip: We don't truncate expanded domains to 253 characters.
zonedata:
  macrod.net:
    - SPF: v=spf1 exists:x.%{d127} -all
  x.macrod.net:
    - A: 127.0.0.2
  zerod.net:
    - SPF: v=spf1 exists:%{d0}.zero.net -all
  macrov.net:
    - SPF: v=spf1 exists:%{ir}.%{v}.macrov.net -all
  4.3.2.1.in-addr.macrov.net:
    - A: 127.0.0.2
  1.0.b.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.macrov.net:
    - A: 127.0.0.2
  escape.net:
    - SPF: v=spf1 exists:%{S}.esc.escape.net -all
  bar%40escape.net.esc.escape.net:
    - A: 127.0.0.2
  pmacro.net:
    - SPF: v=spf1 exists:%{p}.pmacro.net -all
  unknown.pmacro.net:
    - A: 127.0.0.2
  nolocal.net:
    - SPF: v=spf1 exists:%{l}.l.nolocal.net -all
  postmaster.l.nolocal.net:
    - A: 127.0.0.2
  hel.nullsender.net:
    - SPF: v=spf1 exists:%{l}.l.nullsender.net -all
  postmaster.l.nullsender.net:
    - A: 127.0.0.2
  empties.net:
    - SPF: v=spf1 exists:%{l}.l.empties.net -all
  a.b.l.empties.net:
    - A: 127.0.0.2
  trunc.net:
    - SPF: v=spf1 exists:%{h}.trunc.net -all
  bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd.trunc.net:
    - A: 127.0.0.2
---
description: MX address record limit boundary
tests:
  mx-at-10-records:
    description: |
      RFC 7208 section 4.6.4: the evaluation of each "MX" record MUST NOT
      result in querying more than 10 address records. Exactly 10 MX
      records is within the limit and must be evaluated normally.
      The over-limit case (11 records) is covered by rfc7208-tests.yml
      (mx-limit); this is the boundary.
    spec: 4.6.4/2
    mailfrom: "foo@mx10.net"
    host: 1.2.3.4
    result: pass
zonedata:
  mx10.net:
    - SPF: v=spf1 mx -all
    - MX: [1, mxno.mx10.net]
    - MX: [2, mxno.mx10.net]
    - MX: [3, mxno.mx10.net]
    - MX: [4, mxno.mx10.net]
    - MX: [5, mxno.mx10.net]
    - MX: [6, mxno.mx10.net]
    - MX: [7, mxno.mx10.net]
    - MX: [8, mxno.mx10.net]
    - MX: [9, mxno.mx10.net]
    - MX: [10, mxyes.mx10.net]
  mxno.mx10.net:
    - A: 10.0.0.1
  mxyes.mx10.net:
    - A: 1.2.3.4
---
description: Temperror from mechanism DNS lookups
tests:
  a-lookup-error:
    description: |
      RFC 7208 section 5: for the DNS queries done by mechanisms, if the
      DNS server returns an error or the query times out, the mechanism
      stops and the topmost check_host() returns temperror. Here, on the
      address lookup of an "a" mechanism.
    spec: 5/8
    mailfrom: "foo@aerr.net"
    host: 1.2.3.4
    result: temperror
  mx-lookup-error:
    description: |
      Like a-lookup-error, on the MX lookup of an "mx" mechanism.
    spec: 5/8
    mailfrom: "foo@mxerr.net"
    host: 1.2.3.4
    result: temperror
  mx-target-lookup-error:
    description: |
      Like a-lookup-error, on the address lookup of one of the hosts
      returned by the MX lookup of an "mx" mechanism.
    spec: 5/8
    mailfrom: "foo@mxerr2.net"
    host: 1.2.3.4
    result: temperror
zonedata:
  aerr.net:
    - SPF: v=spf1 a:err.aerr.net -all
  err.aerr.net:
    - TIMEOUT: true
  mxerr.net:
    - SPF: v=spf1 mx:err.mxerr.net -all
  err.mxerr.net:
    - TIMEOUT: true
  mxerr2.net:
    - SPF: v=spf1 mx -all
    - MX: [10, err.mxerr2.net]
  err.mxerr2.net:
    - TIMEOUT: true
---
description: Redirect and the lookup limit
tests:
  redirect-at-limit:
    description: |
      RFC 7208 section 4.6.4 includes the "redirect" modifier among the
      terms that cause DNS queries and count against the limit of 10.
      Here the redirect is the 10th such term, so it is still followed.
    spec: 4.6.4/1
    mailfrom: "foo@at10.redir.net"
    host: 1.2.3.4
    result: pass
  redirect-over-limit:
    description: |
      Like redirect-at-limit, but the redirect is the 11th term that causes
      DNS queries, which exceeds the limit and must permerror (rather than,
      for example, being ignored).
    spec: 4.6.4/1
    mailfrom: "foo@over10.redir.net"
    host: 1.2.3.4
    result: permerror
zonedata:
  at10.redir.net:
    - SPF: v=spf1 a:nm.redir.net a:nm.redir.net a:nm.redir.net
                  a:nm.redir.net a:nm.redir.net a:nm.redir.net
                  a:nm.redir.net a:nm.redir.net a:nm.redir.net
                  redirect=target.redir.net
  over10.redir.net:
    - SPF: v=spf1 a:nm.redir.net a:nm.redir.net a:nm.redir.net
                  a:nm.redir.net a:nm.redir.net a:nm.redir.net
                  a:nm.redir.net a:nm.redir.net a:nm.redir.net
                  a:nm.redir.net redirect=target.redir.net
  nm.redir.net:
    - A: 10.0.0.1
  target.redir.net:
    - SPF: v=spf1 ip4:1.2.3.4 -all
---
description: PTR reverse lookup errors
tests:
  ptr-reverse-lookup-error:
    description: |
      RFC 7208 section 5.5: "If a DNS error occurs while doing the PTR RR
      lookup, then this mechanism fails to match." This is an explicit
      exception to the general rule of section 5 that DNS errors cause
      temperror, because the reverse zone is controlled by the owner of
      the connecting IP, not by the publishing domain.
    spec: 5.5/7
    mailfrom: "foo@ptrerr.net"
    host: 1.2.3.4
    result: softfail
    skip: We return temperror instead of treating it as a no-match.
zonedata:
  ptrerr.net:
    - SPF: v=spf1 ptr ~all
  4.3.2.1.in-addr.arpa:
    - TIMEOUT: true
---
description: IP4 network syntax
tests:
  ip4-octet-over-255:
    description: |
      RFC 7208 section 5.6: the qnum ABNF limits each octet to 0-255, so
      values above that are a syntax error.
    spec: 5.6/2
    mailfrom: "foo@byte.ipfour.net"
    host: 1.2.3.4
    result: permerror
  ip4-leading-zero:
    description: |
      RFC 7208 section 5.6: the qnum ABNF does not allow leading zeros
      ("conventional dotted-quad notation"), so they are a syntax error.
    spec: 5.6/2
    mailfrom: "foo@zero.ipfour.net"
    host: 1.2.3.4
    result: permerror
  ip4-empty-cidr:
    description: |
      RFC 7208 section 5.6: ip4-cidr-length requires at least one digit
      after the "/", so a trailing slash is a syntax error.
    spec: 5.6/2
    mailfrom: "foo@cidr.ipfour.net"
    host: 1.2.3.4
    result: permerror
zonedata:
  byte.ipfour.net:
    - SPF: v=spf1 ip4:1.2.3.256 -all
  zero.ipfour.net:
    - SPF: v=spf1 ip4:01.2.3.4 -all
  cidr.ipfour.net:
    - SPF: v=spf1 ip4:1.2.3.4/ -all
---
description: Modifier syntax edge cases
tests:
  qualifier-on-modifier:
    description: |
      Qualifiers apply to mechanisms only: directive = [qualifier]
      mechanism. A qualifier on a modifier ("+redirect=...") makes the term
      invalid (it is not an unknown-modifier either, since a modifier name
      must start with ALPHA), so the record has a syntax error.
    spec: 4.6.1/3, 12/2
    mailfrom: "foo@qualmod.net"
    host: 1.2.3.4
    result: permerror
  unknown-mechanism:
    description: |
      RFC 7208 section 4.6.1: terms that do not contain any of "=", ":" or
      "/" are mechanisms; an unknown mechanism name is a syntax error, and
      it must be caught even if a later term would match.
    spec: 4.6.1/5, 4.6/1
    mailfrom: "foo@unkmech.net"
    host: 1.2.3.4
    result: permerror
  unknown-modifier-repeated:
    description: |
      RFC 7208 section 6: unrecognized modifiers MUST be ignored no matter
      where, or *how often*, they appear in a record. Only "redirect" and
      "exp" are limited to appearing once.
    spec: 6/3
    mailfrom: "foo@unkmod.net"
    host: 1.2.3.4
    result: pass
  unknown-modifier-mechanism-name:
    description: |
      A term like "all=..." or "mx=..." is an unknown modifier, not a
      mechanism: modifiers always contain "=" immediately after the name
      (RFC 7208 section 4.6.1), and neither "all" nor "mx" take an "="
      argument. They must be ignored, not treated as mechanisms or as
      syntax errors.
    spec: 4.6.1/4, 6/3
    mailfrom: "foo@mechmod.net"
    host: 1.2.3.4
    result: pass
  unknown-modifier-empty-value:
    description: |
      The value of an unknown modifier is a macro-string, which can be
      empty: unknown-modifier = name "=" macro-string, with macro-string
      allowing zero characters. "foo=" is thus valid and ignored.
    spec: 12/2
    mailfrom: "foo@emptymod.net"
    host: 1.2.3.4
    result: pass
zonedata:
  qualmod.net:
    - SPF: v=spf1 +redirect=target.qualmod.net ~all
  target.qualmod.net:
    - SPF: v=spf1 ip4:1.2.3.4 -all
  unkmech.net:
    - SPF: v=spf1 foobar ip4:1.2.3.4 -all
  unkmod.net:
    - SPF: v=spf1 moo=cow moo=bull ip4:1.2.3.4 -all
  mechmod.net:
    - SPF: v=spf1 all=deny mx=1.2.3.4 ip4:1.2.3.4 -all
  emptymod.net:
    - SPF: v=spf1 foo= ip4:1.2.3.4 -all