Xeams typically does an MX lookup for foreign domains when sending out emails. If the recipient is local, it skips the MX lookup and sends the message to the IP/host configured for the domain.
If you aim to send every outbound message through a single server, you could specify a Smart Host. Smart Host, however, has one limitation: you cannot specify exceptions. Consider the following scenario:
20.30.40.50
.@example1.com
and @example2.com
.The scenario mentioned above cannot be implemented by Smart Host, since there is no way to force a handful of domains to perform an MX Lookup.
This page talks about an alternate method of specifying rules to route emails for certain sender/recipient through a specific server.
$INSTALL_DIR
.$INSTALL_DIR\config
CustomSmtpRouting.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <CustomRouting> <Routes> <!-- Example 1. Send messages from sales@yourcompany.com to any recipient as long as the recipient does not belong to example1.com, example2.com or is auser@example3.com to 20.30.40.50 --> <Route> <!-- The sender's email address or domain name. Domain names MUST start with an @ symbol. This parameter can only have ONE sender. This is a mandatory field. It cannot be left blank. --> <sender>sales@yourcompany.com</sender> <!-- The recipient's email address or domain name. Domain names MUST start with an @ symbol. The word 'ANY' indicates any domain. This parameter can ONLY have one recipient. This is a mandatory field. It cannot be left blank. --> <recipient>ANY</recipient> <!-- Pipe separated domain names or email addresses to exclude from this route. These exceptions ONLY apply when 'ANY' is used for the 'recipient --> <recipientExceptions>@example1.com|@example2.com|auser@example3.com</recipientExceptions> <!-- IP Address or host name of the server. Multiple IP addresses can be separated by a PIPE. A random IP address is returned when multiple addresses are found. This is a mandatory field. It cannot be left blank. --> <ip>20.30.40.50</ip> </Route> <!-- Route 2 . Send emails from example4.com that are sent to any user in example3.com to 50.40.30.20 --> <Route> <sender>@example4.com</sender> <recipient>@example3.com</recipient> <recipientExceptions></recipientExceptions> <ip>50.40.30.20</ip> </Route> </Routes> </CustomRouting>