Skip to content

A No-Bullshit SPF Flattening tool that helps you deal with those annoyingly long SPF records! Without paying Monthly Cash for it like 100 of Websites out there want you to.

License

Notifications You must be signed in to change notification settings

NightHammer1000/SPFSteamroller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPFSteamroller

A No-Bullshit SPF Flattening tool that helps you deal with those annoyingly long SPF records! Without paying Monthly Cash for it like 100 of Websites out there want you to.

I went through the headace for you, so you can do it for free. Maybe shoot me a donation if I was helpful.

Buy me a coffee

Or donate with crypto over Uniswap:

  • ENS: n1ghtst0rm.uni.eth
  • Address: 0x0b5294668eAF425dDD7DbD8a65BF216232468536

What it Does

Ever had an SPF record that's just too long or has way too many DNS lookups? SPFSteamroller takes care of that by:

  • Flattening your SPF record into pure IP addresses and CIDR ranges
  • Splitting it into multiple records if it gets too long
  • Optionally pushing everything directly to Cloudflare

How to Use It

First Time Setup

  1. Just run the tool once - it'll create a config.ini file for you
  2. Open up the config file and fill in your details:
    [Cloudflare]
    email[email protected]
    apiKey=your-api-key-here
    zoneId=your-zone-id
    domain=yourdomain.com
    updateCloudflare=true/false
  3. Create a TXT record at _masterspf.yourdomain.com with your full SPF record
    • This is your "master" SPF where you'll make all future changes
    • Put everything in here, no matter how messy it is!

Running the Tool

Just run the executable! It will:

  1. Read your master SPF record
  2. Flatten everything into pure IPs and networks
  3. Create nice, clean SPF records
  4. Either:
    • Save them to output.txt (if updateCloudflare=false)
    • Or automatically update your Cloudflare DNS (if updateCloudflare=true)

Want to Make Changes?

  1. Update your master SPF record at _masterspf.yourdomain.com
  2. Run the tool again
  3. That's it! 🎉

How it Works (The Fun Version)

  1. It grabs your messy SPF record and says "let me clean that up for you"
  2. Follows all your includes, looks up all your A/AAAA/MX records
  3. Turns everything into a nice list of IP addresses and networks
  4. If the result is too long (because DNS has limits, you know), it splits it into chunks
    • Creates records like _spf1.yourdomain.com, _spf2.yourdomain.com, etc.
    • Links them together with includes
    • Makes sure your main domain points to the first one

Need to Restore a Backup?

The tool creates backups of your SPF records before making changes. To restore simply run with the -RestoreBackup <Path to Backup> Switch

About

A No-Bullshit SPF Flattening tool that helps you deal with those annoyingly long SPF records! Without paying Monthly Cash for it like 100 of Websites out there want you to.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages