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. .. contents:: To Set Up Using an External Relay Globally ------------------------------------------ #. Log in to the server at the CLI as root, either via SSH or from the terminal #. At the CLI, use the text editor to open ``/var/qmail/control/smtproutes`` .. code-block:: vim /var/qmail/control/smtproutes #. Add the external mail server to the file with the format ``:{external-server}``, replacing ``{external-server}`` with the corresponding information. For example: .. code-block:: :relayhost.com #. Save the file and exit the text editor #. Restart the SMTP service .. code-block:: service smtp restart To Set Up Using an External Relay Per-Domain -------------------------------------------- #. Log in to the server at the CLI as root, either via SSH or from the terminal #. At the CLI, use a text editor to create a file named ``/var/qmail/control/senderroutes``. The following example uses the vim text editor: .. code-block:: vim /var/qmail/control/senderroutes #. 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: .. code-block:: example.com:relayhost.com #. Save the file and exit the text editor #. Restart the SMTP service .. code-block:: service smtp restart