https://github.com/letsencrypt/spf-flattener
https://github.com/letsencrypt/spf-flattener
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/letsencrypt/spf-flattener
- Owner: letsencrypt
- Created: 2024-01-23T21:42:03.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-25T01:43:02.000Z (11 months ago)
- Last Synced: 2025-03-28T03:51:12.572Z (11 months ago)
- Language: Go
- Size: 65.4 KB
- Stars: 12
- Watchers: 5
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SPF-FLATTENER
This tool flattens the SPF record for a given domain to avoid reaching the 10 DNS lookup cap.
## Flags
| Flag | Required? | Type | Default | Description |
|------| ----------| --------| -----|-------------|
| domain | *required* | string | | root domain to set SPF record for |
| initialSPF | *optional* | string | "" | initial SPF record to flatten* |
| verbose | *optional* | bool | false | if true, print extra debug lines |
| dryrun | *optional* | bool | true | if false, update existing SPF record with flattened SPF |
| warn | *optional* | bool | true | if true, compares initial and flattened SPF, warning when different |
| url | *optional*** | string | "" | url to PATCH updated SPF record |
| authEmail | *optional*** | string | "" | X-Auth-Email header value |
| authKey | *optiona*** | string | "" | X-Auth-Key header value |
*if not provided, will lookup and use existing SPF record for domain
**unless dryrun is false, then required
## Example use cases
**Base case**: one-time flatten tool, just want to output flattened record:
```
go run main.go --domain --warn false
```
**Dynamic update case**: update SPF tool that acts without intervention. For example, a cron job that runs:
```
go run main.go --domain --initialSPF "" --dryrun false --warn false --url "" --authEmail "" --authKey ""
```
**Dynamic warning case**: recurring check SPF tool that alerts/warns on change. For example, a cron job that runs:
```
go run main.go --domain --intialSPF=""
```
Then once someone checks/approves of change, run once:
```
go run main.go --domain --initialSPF "" --dryrun false --warn false --url "" --authEmail "" --authKey ""