Your Virtual Private Server can be configured to act as a secondary E-Mail server for domains hosted on other servers, such as another Virtual Private 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 Private 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 your Virtual Private 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 your Virtual Private Server by running the following command from an SSH or Telnet prompt:

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

    % cp ~/etc/ ~/etc/
    % cp ~/usr/local/sendmail/cf/cf/ ~/etc/
  5. You should already have an MX record in the zone file for the domain which points to the primary server. Usually, the default priority for MX records is 10. You will need to create a new MX record with a lower priority (higher number) pointing at your Virtual Private Server.

    For example, if you have an Exchange server with the IP address, you might have created the following records in your DNS Zone file to send E-Mail to the Exchange server:

    exchange   IN   A
           @   IN   MX    10 exchange

    If you want to use your Virtual Private Server as the secondary mail server, as well as to host the Web site for your domain, you would also need to have the following records (the A record and the CNAME are probably already there). In the example, is the IP address of the Virtual Private Server.

           @   IN   A
           @   IN   MX     20 @
         www   IN   CNAME  @

Once your DNS changes have propagated (usually 24-48 hours after you make changes), E-Mail messages for your domain will be delivered to your primary server (the Exchange Server in the example above) when it is available, and if it is not accessible, messages will be queued up on your Virtual Private 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.

Please note: the information on this page applies to ITS web hosting plans. It may or may not apply to other environments. If you are looking for a feature described here, or better support from your hosting provider, please consider hosting your site with ITS!

1555 N Naperville/Wheaton Road, Suite 107
Naperville, IL 60563
phone 630.420.2550
fax 630.420.2771