HOW TO: Configure VestaCP/Exim to send email using SendGrid (CentOS 6) Topic is solved

Questions regarding the Mail Server
Dovecot, Exim, RoundCube
ShaunWHD
Posts: 18
Joined: Tue May 03, 2016 5:30 pm

HOW TO: Configure VestaCP/Exim to send email using SendGrid (CentOS 6)  Topic is solved

Postby ShaunWHD » Tue May 03, 2016 5:56 pm

I've noticed this seems to be a common issue, so I'm sharing the steps I took to get email successfully sending (and receiving) using SendGrid with VestaCP and Exim on CentOS 6.

Make sure that your domain is setup and validated in SendGrid and that your DNS/MX records are properly configured (use mxtoolbox.com to scan your domain. it will tell you if you need to fix anything.). It's also a good idea to make sure your reverse DNS is accurate.

EXIM CONFIGURATION
VestaCP replaces exim.conf with its own version that allows it to properly route emails for VestaCP accounts, so it's important to be careful when editing. Best practice is to backup exim.conf file before editing it

Code: Select all

cp /etc/exim/exim.conf /etc/exim/exim.conf-bkup


1. Open Exim Configuration

Code: Select all

nano /etc/exim/exim.conf



2. You must configure Exim to Authenticate when sending email, or else you'll end up with 550 Authentication errors.
FIND

Code: Select all

host_lookup = *

ADD BELOW

Code: Select all

auth_advertise_hosts = *



3. SendGrid Entries: Add the Credentials, Route and Transport to exim.conf
FIND

Code: Select all

begin authenticators

ADD BELOW

Code: Select all

sendgrid_login:
  driver = plaintext
  public_name = LOGIN
  client_send = : sendgridusername : sendgridpassword

replace sendgridusername and sendgridpassword with your SendGrid login credentials.

FIND

Code: Select all

begin routers

ADD BELOW

Code: Select all

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


FIND

Code: Select all

 begin transports

ADD BELOW

Code: Select all

sendgrid_smtp:
  driver = smtp
  hosts = smtp.sendgrid.net
  hosts_require_auth = smtp.sendgrid.net
  hosts_require_tls = smtp.sendgrid.net



4. Save exim.conf and exit

5. Restart Exim

Code: Select all

/etc/init.d/exim restart


You should now be able to successful send emails using the SendGrid service.

amitz
Posts: 46
Joined: Mon Nov 09, 2015 10:52 am

Re: HOW TO: Configure VestaCP/Exim to send email using SendGrid (CentOS 6)

Postby amitz » Tue May 31, 2016 11:02 am

Hello,

can you tell how to this on centos 7?

I just tried the same steps in centos 7, but doesnt work.

amitz
Posts: 46
Joined: Mon Nov 09, 2015 10:52 am

Re: HOW TO: Configure VestaCP/Exim to send email using SendGrid (CentOS 6)

Postby amitz » Fri Jun 03, 2016 1:14 am

Tried again the same steps and it works also on centos 7 :)
Thanks

KhaoMaNee
Posts: 11
Joined: Thu Feb 26, 2015 5:58 am

Re: HOW TO: Configure VestaCP/Exim to send email using SendGrid (CentOS 6)

Postby KhaoMaNee » Mon Aug 29, 2016 6:48 am

@ShaunWHD Hey, thanks for the guide!
After I've done the settings, I tested it with mail -s, it was able to send to my email. However, it won't send any notification after doing backups in vestaCP. Is it suppose to send email to my catchall email or admin email?

Hassan
Posts: 2
Joined: Mon Nov 07, 2016 2:50 am

Re: HOW TO: Configure VestaCP/Exim to send email using SendGrid (CentOS 6)

Postby Hassan » Wed Nov 09, 2016 4:57 am

Hello thanks for the share, i have implemented the method but now i can send email but not reciving emails


Return to “Mail Server”



Who is online

Users browsing this forum: No registered users and 2 guests