GCE + cPanel + SendGrid = WORKING

196 views
Skip to first unread message

David Adamyan

unread,
Jan 22, 2018, 5:02:23 PM1/22/18
to gce-discussion
Hello everyone,

While the wonderful cPanel support team is helping me to resolve some (other) issues on my server, I wanted to share with you my setting regarding sending email from an GCE instance.
Also followed instructions from: Sendgrid docs

Step 1
+
SMTP2525 - tcp:2525 - Egress   

Step 2
Go to: Main > Service Configuration > Exim Configuration Editor

Add the code in Section: AUTH

sendgrid_login:
  driver = plaintext
  public_name = LOGIN
  client_send = : YourSendGridUsername : YourSendGridPassword

Replace: YourSendGridUsername

Replace: YourSendGridPassword



Step 3

Add the code in Section: PREROUTERS


send_via_sendgrid:
  driver = manualroute
  domains = ! +local_domains
  transport = sendgrid_smtp
  route_list = "* smtp.sendgrid.net::2525 byname"
  host_find_failed = defer
  no_more

Important! Port 587 becomes 2525.


Step 4

Add the code in Section: TRANSPORTSTART


sendgrid_smtp:
  driver = smtp
  hosts = smtp.sendgrid.net
  hosts_require_auth = <; $host_address
  hosts_require_tls = <; $host_address

Step 5

ENABLE SMTP Restrictions in WHM


Step 6

Untick both boxes for "Exim Mail Server (on other port)" inside WHM - Service Manager


Step 7

Make sure you use SPF txt records inside your DNS.   Example:  

"v=spf1 +a +mx +ip<your IP> ~all"

Replace <your IP> with your servers IP.


Step 8

Restart your exim server



Good Luck!



Digil (Google Cloud Platform Support)

unread,
Jan 22, 2018, 6:43:24 PM1/22/18
to gce-discussion
Hello David,

Thank you for your effort on posting the solution. The other community members would receive a benefit from it.

David Adamyan

unread,
Jan 22, 2018, 7:03:06 PM1/22/18
to gce-discussion
Hello Digil,

Yes, of course, before that I had to dig into several websites until I found the solution.

It's good to have a solution, even better to share it!

Klenio Araujo

unread,
Jan 27, 2018, 4:52:48 PM1/27/18
to gce-discussion
A good tip is to observe the sendgrid password. Delete the special password characters, I spent hours trying the exim settings do not support characters in the password

sendgrid_login:
driver = plaintext
public_name = LOGIN
client_send =: aaaaabbbb: AAAbbCCCCCDDD

do not use: &% $ # "! * +
Reply all
Reply to author
Forward
0 new messages