I've a server at Digital Ocean with Ubuntu 16.04.1, configured it with Serverpilot and it's working great! Let's say I'm hosting a website domain.com
which is sending emails with SendGrid. So my DNS records for this domain are:
A @ 123.123.123.123
A www 123.123.123.123
CNAME mail some-sendgrid-domain.com
CNAME s1._domainkey some-sendgrid-domain.com
CNAME s2._domainkey some-sendgrid-domain.com
Now I'd like to have a mail forwarder: test@domain.com
to my @gmail.com
address. Serverpilot installs Postfix by default so I just have to configure the forwarding right?
vi /etc/postfix/main.cf
virtual_alias_domains = domain.com
virtual_alias_maps = hash:/etc/postfix/virtual
vi /etc/postfix/virtual
test@domain.com address@gmail.com
postmap /etc/postfix/virtual
service postfix reload
Now I also need a MX record because Postfix is receiving emails:
MX @ domain.com - prio 10
This should do the job? And what about SPF and DKIM? Is that necessary for forwarding to Gmail? Because every other mail will be send through SendGrid.
This didn't work (no errors in the postfix log and no mails in my Gmail), so I'm now using http://improvmx.com/ for the time being but I'd like to be explicit about my forwarders instead of a catch all.
What's going wrong here? Or what alternatives are there? I prefer to not self host my email, that's why I'm using SendGrid but I just need some forwarders...