Easy way to set up DMARC and SPF for forwarded domains

GoWilkes

Well-Known Member
Sep 26, 2006
692
33
178
cPanel Access Level
Root Administrator
I have 51 parked domains, and it looks like they all need to have their own SPF and DMARC.

Other than going through WHM and setting up each one manually (which is taking forever), is there an easier way? Is there a text file somewhere on the server that I can just copy and paste the data?
 

GoWilkes

Well-Known Member
Sep 26, 2006
692
33
178
cPanel Access Level
Root Administrator
FWIW, the issue I'm having is that most of the emails being sent to my forwarded domains aren't being delivered. If they're sent through the server (like through a contact form) then they are delivered, but emails sent via POP or IMAP are not.

I have a main domain, and emails to that work fine. I have one forwarded domain for which I set up an SPF and DMARC awhile back, and those emails are delivered to the main domain with no problem, too. But the other domains do not have an SPF or DMARC, and those are the ones that aren't receiving the emails. The lack of their own SPF and DMARC is the only reason I can think of.

I added an SPF and DMARC to one of those domains about 2 hours ago, but emails still aren't being delivered. I'm assuming it takes awhile for them to propagate.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Other than going through WHM and setting up each one manually (which is taking forever), is there an easier way? Is there a text file somewhere on the server that I can just copy and paste the data?
Hello :)

For SPF records, you could try using a command such as:

Code:
for i in `ls /var/cpanel/users` ;do  /usr/local/cpanel/bin/spf_installer $i 0 1 0 ;done
This utility is documented at:

The /bin/spf_installer Script - Documentation - cPanel Documentation

You will still receive the output that suggests it fails, but that's simply for the invalid users in the output. Review the zones after the command completes and they should reflect the proper SPF records. As far as the DMARC record, you may find this thread helpful:

Dmarc authentication

Thank you.