mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-20 15:07:03 +00:00
internal/spf: Add an SPF package
This patch adds a package for evaluating SPF, as defined by RFC 7208 (https://tools.ietf.org/html/rfc7208). It doesn't implement 100% of the RFC, but it coves enough to handle the most common cases, and will fail open on the others.
This commit is contained in:
20
cmd/spf-check/spf-check.go
Normal file
20
cmd/spf-check/spf-check.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// Command line tool for playing with the SPF library.
|
||||
//
|
||||
// Not for use in production, just development and experimentation.
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
"blitiri.com.ar/go/chasquid/internal/spf"
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
r, err := spf.CheckHost(net.ParseIP(flag.Arg(0)), flag.Arg(1))
|
||||
fmt.Println(r)
|
||||
fmt.Println(err)
|
||||
}
|
||||
Reference in New Issue
Block a user