Routes specify how and where emails for specific domains should be delivered. Normally, hMailServer uses DNS lookups to determine where email should be delivered. Routes let you override this behaviour. For example,
When a person tries to send an email where the recipient matches a route, hMailServer will use IP ranges and the security settings in the route to determine whether the delivery should be made. Using the two security settings, "When sender matches route" and "When recipient matches route", you specify whether the sender and recipient should be seen as local or external. Combined with the settings in the IP ranges, this specifies when deliveries should be permitted, and whether or not SMTP authentication is required.
If you configure hMailServer to treat recipients matching the route as local addresses, and IP ranges does not permit deliveries to local addresses, the delivery will not be accepted by hMailServer. In the same manner, if you configure the recipient to be treated as external, and the IP ranges specifies that SMTP authentication is required for deliveries to external addresses, hMailServer will require SMTP authentication before accepting the delivery.
The following example explains how to configure all email for the domain
hmailserver.com to go through
mx.hmailserver.com instead of through the default server,
Henceforth, all email sent to
hMailServer.com will go through
mx.hmailserver.com, instead of through the default server,
This example explains how to route all email sent to the domain example.com to another server. In this example, the domain example.com is a "local" domain which we are hosting ourselves. This may be useful for example if we have updated the MX records for a domain but still want to receive email for the domain on the old IP address in case some SMTP sender has not updated their DNS cache.
If hMailServer receives an email addressed to the domain example.com, and it cannot find the recipient in the local installation, it will now deliver the email to the host name you specified in the route. If hMailServer can find the recipient in the local installation, the email will be put in the local account instead - hMailServer only forwards email using routes if the recipients cannot be find locally.
This example explains how to set up a hMailServer installation in a DMZ which forwards all incoming email to a backend server. One common reason for this set up is that you want anti spam and virus protection to be run outside your internal network. Another common set up is companies who are running MicrosoftExchange internally but do not want to expose this server to the Internet.
You should not add the domain to the server in the DMZ - only the route.
If hMailServer receives an email addressed to your domain name, it will forward the message to the backend server. If hMailServer receives an email for an unknown domain, it will be rejected.
One problem with this configuration is that hMailServer does not know which recipients exists on the internal domain. Because of this, hMailServer will accept messages for any recipient matching your domain name and attempt to forward the message to your internal server. If the recipient does not exist in the internal server, a bounce-message will be created, notifying the sender that the recpiients address was invalid. A workaround to this problem is to add all valid recipients in the Route configuration, so that hMailServer knows what recipients are valid. If you do this, hMailServer will not accept the message from the sender and no bounce message will be sent.