THis is my first post. I got an SMTP.COM account and I want all my mails to route through them as a smarthost. However they require smtp authentication, so far I know how to relay mail to their server but not how to authenticate it.
I have also tried the following 2 pieces of code that have failed to have the outbound mail sent to the mimecast server to be sent out:You could do the following. First, you would need to create a file /etc/staticroutes and then input the domains with the IPs they would be routing to off the server:
Code:domain.com1: mail.location1.com (the MX record pointing to the off site server) domain.com2: mail.location2.com (the MX record pointing to the off site server)
Code:static_route: driver = manualroute transport = remote_smtp route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
smart_route:
driver = manualroute
domains = !+local_domains
transport = remote_smtp
route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
smart_route:
driver = manualroute
domains = domain.tld //obviously removed the domain address
transport = remote_smtp
route_list = * mail74.example.co.za
smarthost:
driver = manualroute
domains = !+local_domains
route_data = mail74.example.co.za
transport = remote_smtp
no_more
Hi tristan, I have a recent post asking for this same thing .... I think (http://forums.cpanel.net/f43/smarthost-all-but-dedicated-ips-315991.html#post1297251)You could do the following. First, you would need to create a file /etc/staticroutes and then input the domains with the IPs they would be routing to off the server:
Replace the domain name and the IP with the correct domain name and IP for each one.Code:domain.com1: IP#1 domain.com2: IP#2
Alternatively, you could put into that file:
Again, replace the domain name and the mail server's name with the correct domain name and mail server name for each one.Code:domain.com1: mail.location1.com (the MX record pointing to the off site server) domain.com2: mail.location2.com (the MX record pointing to the off site server)
Next, you would need to go to WHM > Exim Configuration Editor > Advanced Editor and locate the routers area there, then put this into that routers box:
Thanks.Code:static_route: driver = manualroute transport = remote_smtp route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
hostlist smart_hosts = lsearch;/etc/smarthosts
smarthost_dkim:
driver = manualroute
domains = !"+local_domains +smart_hosts"
condition = "${if eq{${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}{$value}}}{}{false}{true}}"
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 64.94.110.0/24
headers_add = "${perl{mailtrapheaders}}"
require_files = "+/var/cpanel/domain_keys/private/${sender_address_domain}"
transport = remote_smtp_smart_dkim
route_list = !+local_domains "${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}}"
smarthost_regular:
driver = manualroute
domains = !"+local_domains +smart_hosts"
condition = "${if eq{${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}{$value}}}{}{false}{true}}"
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 64.94.110.0/24
headers_add = "${perl{mailtrapheaders}}"
transport = remote_smtp_smart_regular
route_list = !+local_domains "${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}}"
remote_smtp_smart_dkim:
driver = smtp
hosts_require_tls = *
interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
dkim_domain = $sender_address_domain
dkim_selector = default
dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}"
dkim_canon = relaxed
remote_smtp_smart_regular:
driver = smtp
hosts_require_tls = *
interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
domain.com: smarthost.com
*.sub.domain.com: smarthost.com
Could you let us know the the specific error message you noticed?After restarting Exim , it would error out and say "unroutable address"
What's the solution/workaround in case the account has forwarders?The workaround from above won't work if a cPanel account has a forwarder setup on their account.
cPanel version 54 offers support for SRS:What's the solution/workaround in case the account has forwarders?
Could you review Post 27 and Post 28 of this thread and let us know if those steps work on your system? If not, could you let us know which step you are stuck with? Note you may find the following document helpful for background knowledge on editing the Exim configuration:Thanks for your link and it seems it is quit difficult. Could you please help me how can I add multiple senders in below route,
550 5.7.368 Remote server returned authentication required to relay -> 550 Please turn on SMTP Authentication in your mail client. ;mail-eopbgr1370075.outbound.protection.outlook.com;(AUS01-SY3-obe.outbound.protection.outlook.com) [40.107.137.75]:24719 is;not permitted to relay through this server without authentication.
2020-06-09 00:18:27 H=mail-eopbgr1370075.outbound.protection.outlook.com (AUS01-SY3-obe.outbound.protection.outlook.com) [40.107.137.75]:24719 X=TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256 CV=no F=<[email protected]> rejected RCPT <[email protected]>: Rejected relay attempt: '40.107.137.75' From: '[email protected]' To: '[email protected]'
SMTP error from remote mail server after RCPT TO: <[email protected]>:
550-Please turn on SMTP Authentication in your mail client.
550-domain.removed.tld [xxx.xxx.xxx.xxx]: 58390 is not permitted to relay
550 through this server without authentication.
* otherserver.tld