Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mail:cpanel-smart-host [2011-07-01 19:08:04]
garrett.plasky Approved
mail:cpanel-smart-host [2015-10-26 16:27:40]
rory.blanchard [Install Exim]
Line 1: Line 1:
-====== Configure Exim to use a Smart Host ====== +====== Configure Exim to use a Smart Host on CentOS ======
-A Smart Host is an SMTP server that will accept mail from another server and then deliver the mail for that server. For example, server1 is setup to use server2 as a smart host. Anytime someone sends e-mail on server1 it is automatically relayed to server2 regardless of the MX entries for the domain. Server2 then accepts this message, looks up the proper delivery host/IP and attempts to deliver the message to that host. While the //Received:// headers will reveal the path of the message having bounced through server2, the entire process is seamless for both the sender and the receiver.+
  
-==== Original Mailserver Config ====+A Smart Host is an SMTP server that will accept mail from another server and then deliver the mail for that server. For example, server1 is setup to use server2 as a smart host. Anytime someone sends e-mail on server1 it is automatically relayed to the Smarthost regardless of the MX entries for the domain. Server2 then accepts this message, looks up the proper delivery host/IP and attempts to deliver the message to that host. While the //Received:// headers will reveal the path of the message having bounced through server2, the entire process is seamless for both the sender and the receiver. 
 +\\ 
 +\\ 
 +===== Install Exim ===== 
 + 
 +To install Exim, you will need to first enable the EPEL repository. **SSH** to your server and run the following commands: 
 + 
 +<code> 
 +yum -y install epel-release 
 +</code> 
 + 
 +Once that has been completed, run the following commands to install Exim. 
 + 
 +<code> 
 +yum -y install exim 
 +</code> 
 +===== Source Mailserver Config =====
 To configure a smart host, create ///etc/exim.conf.local// on the source server (server1 in this example) and add the following lines. Be sure to change to the hostname or IP of the smart host server. To configure a smart host, create ///etc/exim.conf.local// on the source server (server1 in this example) and add the following lines. Be sure to change to the hostname or IP of the smart host server.
  
-<sxh plain>@ROUTERSTART@+<code>@ROUTERSTART@
     smart_route:     smart_route:
     driver = manualroute     driver = manualroute
     domains = !+local_domains     domains = !+local_domains
     transport = remote_smtp     transport = remote_smtp
-    route_list = * host.name.of.smart.host.server</sxh>+    route_list = * host.name.of.smart.host.server 
 +</code>
  
 Assuming this server (server1) is a cPanel server, next run <c>/scripts/buildeximconf</c> and then <c>/scripts/restartsrv_exim</c>. If not, simply restart your Exim server using normal init scripts. Assuming this server (server1) is a cPanel server, next run <c>/scripts/buildeximconf</c> and then <c>/scripts/restartsrv_exim</c>. If not, simply restart your Exim server using normal init scripts.
 +\\
 +\\
 +===== Source Mailserver Config (with cPanel) =====
  
-==== Smarthost Server Config ==== +Log into **WHM**.
-Assuming you're installing the yum version of Exim on a CentOS/RHEL server, you'll need to make two configuration changes. The first is to allow the IP of the mailserver to relay through the smarthost. Open the configuration at ///etc/exim/exim.conf//, find the line referenced below and edit it replacing **x.x.x.x** with your mailserver IP.+
  
-<sxh plain>hostlist   relay_from_hosts = 127.0.0.1 : x.x.x.x</sxh>+Go into **Mail**, **Exim Configuration**, and then search for **SmartHost support** in **Basic Settings**. 
 + 
 +In the text box put in the following, replacing **X.X.X.X** with the IP address or the hostname of the SmartHost server: 
 + 
 +<code> 
 +* X.X.X.X 
 +</code> 
 +\\ 
 +\\ 
 +===== Smarthost Server Config ===== 
 +Assuming you're installing the yum version of Exim on a CentOS/RHEL server, you'll need to make two configuration changes. The first is to allow the IP of the mailserver to relay through the smarthost. Open the configuration at ///etc/exim/exim.conf//, find the line referenced below and edit it replacing **X.X.X.X** with your mailserver IP. 
 + 
 +<code> 
 +hostlist   relay_from_hosts = 127.0.0.1 : x.x.x.x 
 +</code>
  
 Second, you'll need to tell Exim not to listen only on the localhost address for incoming mail, which is the default. Again find the configuration line below and add a hash (**#**) in front of it to comment it out. Second, you'll need to tell Exim not to listen only on the localhost address for incoming mail, which is the default. Again find the configuration line below and add a hash (**#**) in front of it to comment it out.
  
-<sxh plain>local_interfaces = <; 127.0.0.1 ; ::1</sxh>+<code>local_interfaces = <; 127.0.0.1 ; ::1</code>
  
 Save the modified config file and restart Exim on this server. Save the modified config file and restart Exim on this server.
  
 That's it; watch the logs for a bit to make sure it's working! The easiest way is to just <c>tail -f /var/log/exim_mainlog</c> on both servers and then send a message from server1 to a remote host, and watch for the mail to travel out server2! That's it; watch the logs for a bit to make sure it's working! The easiest way is to just <c>tail -f /var/log/exim_mainlog</c> on both servers and then send a message from server1 to a remote host, and watch for the mail to travel out server2!
 +\\ 
 +\\
 {{tag>exim cpanel smtp how-to}} {{tag>exim cpanel smtp how-to}}