25

I am having a PHP web application with SendGrid integration for both incoming (parse webhook) and outcoming mail (PHP mail() with system configuration for mail proxy). Currently our incoming mail system consists of an endpoint, which saves all contact emails to our database. We want also to have some direct email forwarding mappings to other mail providers (like ceo@mysite.com => my.address@example.com).

As far as I know, there is no routing of email or forwarding them with SMTP protocol in SendGrid's side, only plain API calls connecting to our endpoint. Creating MX records pointing to our IP address is not an option, as we don't want to reveal our servers' origin IP address to the public (DDoS risk).

Should I just write code to get the contents of email and mail() it forward? Some data will be missing, but for the most part it should work. Or is there a way to connect something like a Gmail Business account to listen for mails for these specific addresses?

hegez
  • 958
  • 7
  • 12
  • Did you find the solution to your question? I have the same problem. sending emails only supports JSON, so even if I get raw payload from Sendgrid I can't use the same payload to send via Sendgrid, instead we have create a new JSON request and embed everything including attachments. Is there a better way? – Pouya Sanooei Apr 17 '18 at 19:58
  • @PouyaSanooei Haven't still found a good way to forward mails. – hegez Apr 18 '18 at 13:29
  • any updates on this in 2020? – Korede Aderele Oct 11 '20 at 20:07
  • consider using a third-party email forwarding service, you can offload the responsibility of email routing and forwarding, reducing the exposure of your server's IP address to potential DDoS attacks. – Arian Sakhaei Jul 03 '23 at 07:18

0 Answers0