mirror of
https://github.com/emersion/go-msgauth
synced 2026-07-11 00:08:39 +00:00
31 lines
776 B
Markdown
31 lines
776 B
Markdown
# go-msgauth
|
|
|
|
[](https://godoc.org/github.com/emersion/go-msgauth)
|
|
[](https://travis-ci.org/emersion/go-msgauth)
|
|
|
|
A Go library to create and parse [Authentication-Results header fields](https://tools.ietf.org/html/rfc7601).
|
|
|
|
## Usage
|
|
|
|
```go
|
|
// Format
|
|
results := []msgauth.Result{
|
|
&msgauth.SPFResult{Value: msgauth.ResultPass, From: "example.net"},
|
|
&msgauth.AuthResult{Value: msgauth.ResultPass, Auth: "sender@example.com"},
|
|
}
|
|
s := msgauth.Format("example.com", results)
|
|
log.Println(s)
|
|
|
|
// Parse
|
|
identifier, results, err := msgauth.Parse(s)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
log.Println(identifier, results)
|
|
```
|
|
|
|
## License
|
|
|
|
MIT
|