{"id":23055485,"url":"https://github.com/mistralmail/gospf","last_synced_at":"2025-10-12T17:46:00.135Z","repository":{"id":30277777,"uuid":"33829285","full_name":"mistralmail/gospf","owner":"mistralmail","description":"SPF (Sender Policy Framework) for Go","archived":false,"fork":false,"pushed_at":"2023-08-17T18:34:09.000Z","size":39,"stargazers_count":10,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-14T03:27:31.638Z","etag":null,"topics":["go","golang","mail","sender-policy-framework","spf"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mistralmail.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-12T18:53:46.000Z","updated_at":"2025-03-22T10:52:30.000Z","dependencies_parsed_at":"2024-06-19T09:17:21.455Z","dependency_job_id":"01a6f40e-31c4-42ee-a3e3-458f0e9b2031","html_url":"https://github.com/mistralmail/gospf","commit_stats":null,"previous_names":["mistralmail/gospf","gopistolet/gospf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mistralmail/gospf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mistralmail%2Fgospf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mistralmail%2Fgospf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mistralmail%2Fgospf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mistralmail%2Fgospf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mistralmail","download_url":"https://codeload.github.com/mistralmail/gospf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mistralmail%2Fgospf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012193,"owners_count":26085079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","mail","sender-policy-framework","spf"],"created_at":"2024-12-16T01:12:21.757Z","updated_at":"2025-10-12T17:46:00.097Z","avatar_url":"https://github.com/mistralmail.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"GoSPF\n=====\n\n*Sender Policy Framework for Go*\n\n\nUsage\n-----\n\nGet GoSPF and run all unit test:\n\n    $ go get github.com/mistralmail/gospf\n    $ cd $GOPATH/src/github.com/mistralmail/gospf\n    $ go test ./...\n\n### Command line tool\n\nCompile the code:\n\n    $ go build -o spf github.com/mistralmail/gospf/gospf\n\nYou can run GoSPF in the console to validate an IP address against a domain: `./spf domain ip [\"debug\"]`. e.g.:\n\n    $ ./spf google.com 66.249.80.0\n\n*With `debug` flag added, GoSPF will output the whole parsed SPF object.*\n\n\n### Library\n\nGoSPF is meant to be included in other projects.\nTo use GoSPF you must create a new `SPF` instance (witch takes a domain and a `gospf/dns` interface).\nOnce you have the `SPF` instance you can call `CheckIP(ip string)` on it,\nwhich will return a response following [*RFC 7208 2.6. Results of Evaluation*](https://tools.ietf.org/html/rfc7208#section-2.6)\n(i.e. `Neutral`, `Pass`, `SoftFail`, `Fail`, ...)\n\nExample:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/mistralmail/gospf\"\n    \"github.com/mistralmail/gospf/dns\"\n)\n\nfunc main() {\n\n    domain := \"google.com\"\n    ip     := \"66.249.80.0\"\n\n    // create SPF instance\n    spf, err := gospf.New(domain, \u0026dns.GoSPFDNS{})\n    if err != nil {\n        fmt.Println(err)\n        return\n    }\n\n    // check the given IP on that instance\n    check, err := spf.CheckIP(ip)\n    if err != nil {\n        fmt.Println(err)\n        return\n    }\n\n    fmt.Println(ip, \"-\u003e\", check)\n\n}\n\n```\n\n\nImplementation\n--------------\n\n**Directives**  \nGoSPF supports `all`, `include`, `a`, `mx`, `ip4` and `ip6` mechanisms with the respective qualifiers `+`, `?`, `~` and `-`. All implemented as defined in [RFC 7208](https://tools.ietf.org/html/rfc7208).\nSupport for `exists` mechanism isn't implemented yet. \nSupport for `ptr` mechanism is no priority:\n\n\u003e Use of the ptr mechanism and the %p macro has been strongly\n\u003e discouraged (Sections 5.5 and 7.2).  The ptr mechanism and the %p\n\u003e macro remain part of the protocol because they were found to be in\n\u003e use, but records ought to be updated to avoid them.\n\n**Modifiers**  \nCurrently only support for `redirect` modifier. (Other modifiers won't cause parse errors.)\n\n**Macros**  \nMacros aren't supported (yet).\n\n\nLicense\n-------\n\nGoSPF is licensed under the [BSD 2-clause “Simplified” License](https://github.com/mistralmail/gospf/blob/master/LICENSE.txt).\n\n\nAuthor\n------\n\nMathias Beke - [denbeke.be]()\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmistralmail%2Fgospf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmistralmail%2Fgospf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmistralmail%2Fgospf/lists"}