How to set up smarthost for a single domain in exim mail...

How to set up smarthost for a single domain in exim mail server

by -
0 1526

How to set up smarthost for a single domain in exim mailserver.

As per one our client requirement. I had to set up smarthost for single domain in exim. I have googled and took some support from Cpanel support forum. Finally I have done in our exim server.

 

Prerequisites:

1:- client exim server IP(44.252.91.161) Should be relayed in smarthost server.

2:- Our smarthost server IP 77.86.3.242 (mail.jingleonfo.com)

 

Steps:- 1

Login client exim server.

[email protected] [~]# vim /etc/smarthosts
mail.jingleinfo.com

[email protected] [~]# vim /etc/staticroutes
6987.in: mail.jingleinfo.com

step:-2

First, put this in the @[email protected] section of /etc/exim.conf.local:

[email protected] [~]# vim /etc/exim.conf.local
hostlist smart_hosts = lsearch;/etc/smarthosts

#Then, put this in @[email protected] section.

[email protected] [~]# vim /etc/exim.conf.local

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 : 43.252.91.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 : 43.252.91.0/24
headers_add = “${perl{mailtrapheaders}}”
transport = remote_smtp_smart_regular
route_list = !+local_domains “${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}}”

Step:-3

Then, this in put below line  @[email protected]: section.

[email protected] [~]# vim /etc/exim.conf.local
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}}

Step:- 4

Run below command to rebuild exim.conf.

[email protected] [~]# /scripts/buildeximconf

[email protected] [~]#  service exim restart

[email protected] [~]# tail -f  /var/log/exim_mainlog | grep “gopal”
2015-10-19 17:51:36 1Zo9RY-0000mH-Ho <= [email protected] H=(kvit.in) [127.0.0.1]:46147 P=esmtpa A=dovecot_login:[email protected] S=546 [email protected] T=”test” for [email protected]
2015-10-19 17:51:36 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1Zo9RY-0000mH-Ho
2015-10-19 17:51:38 1Zo9RY-0000mH-Ho [77.86.3.242]] SSL verify error: depth=0 error=self signed certificate cert=/CN=ns1.linuxdnhost.com/[email protected]
2015-10-19 17:51:38 1Zo9RY-0000mH-Ho [77.86.3.242] SSL verify error: certificate name mismatch: “/CN=ns1.linuxdnhost.com/[email protected]
2015-10-19 17:51:40 1Zo9RY-0000mH-Ho => [email protected] R=smarthost_dkim T=remote_smtp_smart_dkim H=jingleinfo.com [77.86.3.242] X=TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256 CV=no C=”250 OK id=1Zo9Rb-0000IP-Bn”

Download PDF

CEO, KV IT-Solutions Pvt. Ltd. | [email protected] | 9810028374|
Linux Professional and an Industrial Trainer | 20 + years Experience in IT Industry

” We are born free, No Gate and Windows can snatch our freedom “

SIMILAR ARTICLES

0 1522

0 1163

0 1056

NO COMMENTS

Leave a Reply