1

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: [email protected] 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
  • 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...

1
  • When you test, what are the headers of your incoming test email: Is there a DKIM signature header? The standard "From" header points to some from-domain. Is there SPF or DKIM or DMARC on this from-domain? Please edit the question.
    – kubanczyk
    Oct 6, 2016 at 9:13

1 Answer 1

0

I've found a alternative for SendGrid: Mailgun which makes it possible to also receive emails, see: https://documentation.mailgun.com/user_manual.html#receiving-forwarding-and-storing-messages. This way I don't have to do anything with mail on my server.

Edit: I just wrote a blog post about this: https://royduineveld.nl/free-email-forwarding/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .