A short post on checking email SPF records (with python).
python -m spf <domain.com> and record the output. Alternatively you can use
nslookup -q=TXT <domain> and look for one that starts with
Next validate the senders ip by running
python -m spf "<spf output>" <the.ipv4.addr.val> <domain.com> a.
You should see
result: ('pass', 250, 'sender SPF authorized') mx!
If the ip is wrong or SPF is not configured correctly, you'll see something like
result: ('fail', 550, 'SPF fail - not authorized') -all.