1package store
2
3import (
4 "github.com/mjl-/mox/spf"
5)
6
7var spfValidations = map[spf.Status]Validation{
8 spf.StatusNone: ValidationNone,
9 spf.StatusNeutral: ValidationNeutral,
10 spf.StatusPass: ValidationPass,
11 spf.StatusFail: ValidationFail,
12 spf.StatusSoftfail: ValidationSoftfail,
13 spf.StatusTemperror: ValidationTemperror,
14 spf.StatusPermerror: ValidationPermerror,
15}
16
17// SPFValidation returns a Validation for an spf.Status.
18func SPFValidation(status spf.Status) Validation {
19 v, ok := spfValidations[status]
20 if !ok {
21 panic("missing spf status validation")
22 }
23 return v
24}
25