How to: Forward Mail Through an External SMTP Server

InterWorx allows the ability to relay messages sent from the InterWorx Server through an external SMTP Server. This can be done at a server-wide (Smtproutes), or domain-specific (Senderroutes) level.

More detailed information on Smtproutes can be found here.

Note

The external SMTP server must be configured to allow the InterWorx server to relay through it.

To Set Up Using an External Relay Globally

  1. Log in to the server at the CLI as root, either via SSH or from the terminal

  2. At the CLI, use the text editor to open /var/qmail/control/smtproutes

    vim /var/qmail/control/smtproutes
    
  3. Add the external mail server to the file with the format :{external-server}, replacing {external-server} with the corresponding information. For example:

    :relayhost.com
    
  4. Save the file and exit the text editor

  5. Restart the SMTP service

    service smtp restart
    

To Set Up Using an External Relay Per-Domain

  1. Log in to the server at the CLI as root, either via SSH or from the terminal

  2. At the CLI, use a text editor to create a file named /var/qmail/control/senderroutes. The following example uses the vim text editor:

    vim /var/qmail/control/senderroutes
    
  3. Add the domain to be forwarded, and the external mail server to the file with the format {domain}:{external-server}, replacing {domain} and {external-server} with the corresponding information. For example:

    example.com:relayhost.com
    
  4. Save the file and exit the text editor

  5. Restart the SMTP service

    service smtp restart