Question
How do you create a smarthost route list for a set of domains instead of all domains?
Answer
When there is a requirement to send a single domain or a particular set of domains to a configured smarthost, a route list needs to be read from a file instead of using an asterisk as a wildcard.
- Access the server's command line as the 'root' user via SSH or Terminal in WHM.
-
Create the file to contain the domains and the associated routes:
# touch /etc/smartdomains.txt
-
Change the group ownership of the file to the
mailgroup:# chgrp mail /etc/smartdomains.txt
-
Set the file permissions to 640:
# chmod 640 /etc/smartdomains.txt
- Open the file in your preferred text editor.
-
Add each domain and the smarthost route to use for the domain to the file using the following format:
CONFIG_TEXT: $domain.tld: $smart.host.tld::$port
Note: "$domain.tld," "$smart.host.tld," and "$port" must be replaced with the domain name of the domain to use the smarthost, the smarthost's hostname, and the smarthost's port number, respectively. Additionally, each domain's entry must be on a separate line.
- Save the changes and exit the text editor.
- Log in to WHM as the ‘root’ user.
- Navigate to Home / Service Configuration / Exim Configuration Manager.
- Click the Advanced Editor tab.
-
Configure Exim to use the smarthost if one is not already configured. You will need to configure the smarthost manually using the Exim configuration options appropriate to your smart host.
Note: Your smart host provider can furnish you with the required directives and what sections in which to place them.
-
Replace the route_list line in the PREROUTERS block with the following line:
CONFIG_TEXT: route_data = ${lookup{$sender_address_domain}lsearch*{/etc/smartdomains.txt}}
Note: "/etc/smartdomains.txt" must be replaced with the file created earlier if the file was created with a different name.
- Remove the
no_moreline if present. - Scroll to the bottom of the page.
- Click the Save button.
Comments
0 comments
Article is closed for comments.