I've struggled with correctly setting up SPF and DMARC for a new VPS. In testing, I thought I had it right after reading many articles and using many online testing websites. But I kept getting failures until I realized my short test code:
cat $FILE | mail -s "Subject: Admin Status" someone@somewhere.com
was missing the "-r" return address option to the mail command. So now my short test code:
cat $FILE | mail -r someone@roamin-nomen.name -s "Subject: Admin Status" someone@somewhere.com
passes both SPF and DMARC with that one simple change.