Harry Jiang
Harry Jiang

Reputation: 731

How do I alternate domains for sending emails for my app running on Heroku with Sengrid Add-on?

So we are running a rails app on Heroku with the Sengrid add-on (free plan so no whitelabeling) (let's call it magicapp) and in our action mailer we always set the from field to be "[email protected]". We have seen some of our email go to spam and someone suggested to us to try to alternate our email domain to improve deliverability.

So my questions are as follows:

  1. What verification and checking goes on at the receiver side to verify that the email really is sent from "magicapp" and not just someone pretending to be magicapp?

  2. Right now, when we send an email from "[email protected]" the email says it's from "[email protected] via sendgrid.me" so when receiver clients are doing spam checking, do they use my "magicapp.com" domain for reputation or the "sengrid" domain?

  3. If it does use the "magicapp.com" domain, could I just set my from field in my action mailer to be a different domain such as "magicapp-mail.com"? Are there any potential issues to this or additional things to set up, like DNS etc? If I do this, will the receiver use the reputation of the magicapp-mail domain instead of magicapp then?

Any answers or information would be much appreciated, thanks!

Upvotes: 0

Views: 1026

Answers (2)

jacobmovingfwd
jacobmovingfwd

Reputation: 2273

The key is your 2nd question. As long as you're not whitelabeled, the receiving server 'knows' the mail came from SendGrid, so it checks SendGrid for all DKIM & SPF records. SendGrid signs your mail with their own DKIM if you're not whitelabeled, so it all checks through.

"Alternating" the domain does not sound like a feasible way to avoid bulking of your mail. We're still in an IPv4 world, and IPs are still the main source of reputation tracking in the email world. No matter what domain your mail says it's "From", the receiving server knows what IPs gave it the mail (unless your domain is so bad it's blacklisted).

What does mail-tester.com say about your mail?

Upvotes: 1

rmagnum2002
rmagnum2002

Reputation: 11421

I am pretty sure setting sendgrid's DKIM and SPF records properly will save your emails from being sent to spam. At least that's what worked in my app I was working on and emails ended in inbox, unless users hit Mark as spam instead of unsubscribe.

DKIM

DKIM stands for DomainKeys Identified Mail which was designed to help ISPs prevent malicious email senders by validating email from specific domains.

What a basic DKIM record should look like:

smtpapi._domainkey.yourdomain.com.  |  TXT or CNAME  |  value
smtpapi._domainkey.subdomain.yourdomain.com.  |  TXT or CNAME  |  value

TXT value: k=rsa; t=s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPtW5iwpXVPiH5FzJ7Nrl8USzuY9zqqzjE0D1r04xDN6qwziDnmgcFNNfMewVKN2D1O+2J9N14hRprzByFwfQW76yojh54Xu3uSbQ3JP0A7k8o8GutRF8zbFUA8n0ZH2y0cIEjMliXY4W4LwPA7m4q0ObmvSjhd63O9d8z1XkUBwIDAQAB

CNAME value: dkim.sendgrid.net

docs: https://sendgrid.com/docs/Glossary/dkim.html

SPF

Sender Policy Framework (SPF) is an email authentication standard developed by AOL that compares the email sender’s actual IP address to a list of IP addresses authorized to send mail from that domain. The IP list is published in the domain’s DNS record.

The DNS record should look like this:

yourdomain.com.  |  TXT  |  v=spf1 a mx include:sendgrid.net ~all

docs: https://sendgrid.com/docs/Glossary/spf.html

Upvotes: 2

Related Questions