Setting MX records to allow different servers to send and receive email

emailmx-recordpop3smtp

I have a site (mydomain.com) that uses the hosting service to send and receive emails (the MX points to mail.mydomain.com).

Now I want to keep the same server to send emails but use a third party service to receive and process the incoming emails (I'm thinking on SendGrid's Parse API).

I know I can just change my MX to point to SendGrid and with that I will be able to receive the emails, but the problem is that if the MX is configured that way, the outgoing email (sent from mail.mydomain.com) might get treated as spam since it is coming from a server different than the one pointed by the MX.

Will the creation of a second MX entry (keeping the one pointing to SendGrid with higher priority) suffice to prevent these issues?

Thanks

Best Answer

No you should add the mail server to your SPF record.

For example:

mydomain.com.      IN TXT     "v=spf1 mx a a:mail.mydomain.com ?all"

If mail.mydomain.com was an MX record for the domain, it would be covered by mx.