I recently set a custom from address to match my domain for user related emails: password resets & email confirmations.
That led to the strange situation where emails sent from my debug environment arrived fine, but emails sent from any other environment did not arrive. After a brief exchange with Anvil support, it turns out my DMARC policy was causing those emails to be rejected.
Does anyone have experience setting up a DMARC policy that would allow those emails to be accepted? I’m assuming I’d need to add something for the server Anvil’s using to originate the emails?
Edit: or are there DNS entries that would allow Anvil to send email from my domain, similar to what I’d setup with another external email service?
Hi @jshaffstall,
This is quite a common problem where you configure an Anvil app to send from a custom domain (without Custom SMTP), but you also configure the DMARC DNS records for that domain to require emails to pass SPF or DKIM checks (as you have done with your domain). It is sensible to require those checks, so the correct fix here is to configure Anvil to DKIM-sign the emails coming from your app.
Setting up DKIM to work on a custom domain without custom SMTP requires some setup at our end, and some DNS configuration at your end. You should start by sending an email to support@anvil.works asking to have DKIM signing set up for a particular domain. We will update the necessary configuration, then you will receive an email containing instructions for setting up the necessary DNS entries on your domain. Once that is done, emails from your Anvil app should be correctly DKIM-signed and your deliverability issues should be resolved 
I hope that helps!
P.S. The reason your emails worked from your debug environment is that the custom domain was not considered a valid FROM
address in that environment, so something@anvil.app
was used instead. Emails from *.anvil.app
are always correctly signed by Anvil, so your messages got through just fine.
6 Likes