www.digitaldaze.com
Using your virtual server as a secondary mail server

The virtual server can be configured to act as a secondary E-Mail server for domains hosted on other servers, such as another virtual server, or a Microsoft Exchange Server configured for Mail-On-Demand. When the primary E-Mail server is unavailable, messages will be sent to the secondary server, where they will be queued up for delivery once the primary server is available again.

Configuring your Server for relaying

In order to prevent unauthorized use of your virtual server, only E-Mail for specified domains is allowed to be queued up and delivered. When a domain is added to a server, the domain is listed in the ~/etc/local-host-names file to tell sendmail that E-Mail to the domain should be accepted and delivered to local E-Mail accounts. In a similar way, you can set up your server to act as a secondary server by adding the domain to the ~/etc/relay-domains file.

  1. If you haven't already done so, check to make sure that all your local domain names are listed in the ~/etc/local-host-names file on the virtual server, one domain per line. Any E-Mail for domains not listed there will not be delivered properly.

  2. Create a file in the ~/etc directory of your Virtual Private Server named relay-domains. List any domains you want to allow relaying for, one domain per line, in this file.

  3. If you haven't already done so, install the sendmail m4 macros on the virtual server by running the following command from a shell prompt:

    % vinstall sendmail
  4. Create a copy of the old sendmail.cf file, then copy the ~/usr/local/sendmail/cf/cf/default.cf file to ~/etc/sendmail.cf.

    % cp ~/etc/sendmail.cf ~/etc/sendmail.cf.old
    % cp ~/usr/local/sendmail/cf/cf/default.cf ~/etc/sendmail.cf

DNS Configuration

There should already be an MX record in the DNS zone file for the domain which points to the primary mail server, if not one should be created. Usually, the default priority for MX records is 10. A new MX record with a lower priority (higher number) will need to be created that resolves to the virtual server. If we are providing DNS for the domain, a DNS request can be submitted to customer service asking to have an MX record added for the new mail server. Be sure to specify the new server's hostname or IP address and if it should be the primary or secondary mail server.

Once your DNS changes have propagated (usually 24-48 hours after changed), E-Mail messages for the domain will be delivered to the primary server (i.e. the Exchange Server in the example above) when it is available, and if it is not accessible, messages will be queued up on the virtual server. When messages for a relay domain are queued up on the secondary server, it will check on a regular basis to see if the primary server is available. As soon as the primary server is accessible, the messages will be automatically dequeued to the primary server.

 

[Legal Notice]
http://www.digitaldaze.com