1

I'm currently using a relay service (mailchannels and sendgrid) to send about 200k messages per month of our cPanel services, but I'd like to route only messages that have HOTMAIL recipients (because they're the main reason for us to relay mails.. our messages are never delivered on mailbox using our ips -- GMAIL and all other providers are delivered without problems).

This is how my config looks like:

SECTION: AUTH
sendgrid_login:
driver = plaintext
public_name = LOGIN
client_send = : USER : PW

-

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

-

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

I know that I should change the PREROUTERS section and out some condition there, but don't know how!

Any help will be appreciated.

Thanks!

rnehme
  • 15
  • 6

2 Answers2

0

The domains condition controls what "To" addresses use this rule. Currently this is "not addresses in the local domain group". Change the domains line to match hotmail.com:

send_via_sendgrid:
driver = manualroute
domains = hotmail.com
transport = sendgrid_smtp
route_list = "* smtp.sendgrid.net::587 byname"
host_find_failed = defer
no_more
DerfK
  • 19,313
  • 2
  • 35
  • 51
0

For WHM/Cpanel, and for me the best solution for not problem with Cpanel's setup exim, it's:

Create a file /etc/staticroutes

hotmail.com: IP_OF_SMARTHOST__OR__FQDN
otherdestinationdomain: IP_OF_SMARTHOST__OR__FQDN
...  

Go to Exim Configuration Manager --> Advance editor --> Section: POSTMAILCOUNT

 static_route:
   driver = manualroute
   transport = remote_smtp
   route_data = ${lookup{$domain}partial-lsearch{/etc/staticroutes}}

Whit this configuration you can use multiples smarthost and diferents routes and when Cpanel update exim you can lost changes.

Exim Configuration Manager

abkrim
  • 407
  • 6
  • 18