Hexamail - Setting up your mail server

Setting up your mail server for use with Hexamail

IMPORTANT: This help refers to manually configuring your email server for use with Hexamail. If you have chosen to automatically integrate with Exchange 2000-2016 on the same machine as Hexamail you should NOT make any of the changes detailed on this page.

I have Microsoft Exchange and want to run Hexamail on the same server machine


I want to run Hexamail on the same machine as my mail server


I want to run Hexamail on a separate machine to my mail server


My users do not use SMTP to send email

(For example if they send email from Notes Client or MS Outlook via Exchange)



Running on the same machine as your mail server



You can run Hexamail on the same physical machine or server as your email server software. To do this you need to change the port number that your email server listens on for incoming email. Details on whether and how you can do this should be found in your email server documentations. Change the email server port to an unused port other than port 25, for example 2500. Next configure Hexamail to listen on port 25 (SMTP Server settings) and relay to server 127.0.0.1 and port 2500 (SMTP Relay settings). Be sure to stop and start your email server package and then Hexamail to ensure the changes take effect. If your email server is still listening on port 25 when Hexamail attempts to you will see a line in the SMPT Server log file stating this. NOTE: during the process of switching the ports and stopping and starting your email server there will be a very short period where you cannot receive emails. It is recommended that you perform this task at a period when email traffic is low, for example first thing in the morning, last thing at night or over a weekend.



Specific information for the listed email servers is available by clicking the links below:

If your server is not on the list, please consult the documentation for your server on how to change the port number.












Running on a separate machine to your mail server


I can change my Network Address Translation (NAT) at my router/firewall or the MX Entry for my domain

I can change the IP Address of my mail server machine



Running on a separate machine to your mail server - By changing your NAT settings/MX Entry



Once you are satisfied that Hexamail is functioning correctly you need to make it a live part of your email system. You can either change the NAT settings at your router/firewall or MX entry used to send email to your organization to point to the server running Hexamail. This section deals with NAT/MX Entry changes:




NAT Setting Changes
If you are to change the NAT entries for incoming SMTP (port 25 TCP) traffic, please refer to the user guide for your firewall or router.

MX Entry Changes
If you are to change the MX entries used for your email routing on the Internet, please refer to your ISP or domain hosting company's documentation on how to change MX entries for your domain. Here is an example of the MX change process. Assume that you have a domain (example.com) running your own SMTP server (mail.example.com). Let's also assume you have another domain example.co.uk, whose mail is also handled by your mail server, on the same IP address/machine.

The MX record for example.com may look something like:
example.com MX preference = 0, mail exchanger = mail.example.com
mail.example.com internet address = 209.34.170.2

While the MX record for example.co.uk may look like:
example.co.uk MX preference = 0, mail exchanger = mail.example.com
mail.example.co.uk internet address = 209.34.170.2

To implement Hexamail Guared with minimal impact you would do the following. Run Hexamail (on the same server or on a separate one) to listen on a different IP, for example on 209.34.170.4, and let's assign mail2.example.com to it.
Reconfigure the MX records as follows:

The MX record for example.com now looks something like:
;this makes Hexamail your primar mail handler
example.com MX preference = 0, mail exchanger = mail2.example.com

;you can add this to keep your existing MTA as a backup in case you stop Hexamail running
example.com MX preference = 10, mail exchanger = mail.example.com
mail.example.com internet address = 209.34.170.2
mail2.example.com internet address = 209.34.170.4

While the MX record for example.co.uk will look like:
;this makes Hexamail your primar mail handler
example.co.uk MX preference = 0, mail exchanger = mail2.example.com

;you can add this to keep your existing MTA as a backup in case you stop Hexamail running
example.co.uk MX preference = 10, mail exchanger = mail.example.com
mail.example.com internet address = 209.34.170.2
mail2.example.com internet address = 209.34.170.4

Please note the comment relative to the backup MX record. While it's a good idea to add them in case you stop the Hexamail service, bear in mind that some mass marketing companies and SPAMmers will try to send emails to every server they find an MX record for. This means that they can send mail directly to your unprotected smtp server, which will bypass Hexamail and thus deliver the spam to the intended recipient. Leave those entries there until you are happy that Hexamail is setup correctly and can be left running permanently (for example after a trial period)
Once you have made these changes, your primary MX record points to the IP on which Hexamail listens on. Emails to your company now go to Hexamail first and are then forwarded on to your SMTP server at mail.example.com. Your existing users who have mail.example.com for SMTP server in their email client configuration should still use that as their SMTP server, as then Hexamail cna alsoprocess out going email for you.

Running on a separate machine to your mail server - By switching your IP Addresses



You can switch the IP address of your email server and the server Hexamail are running on once both servers are running.



Once both servers are running and email can be sent through Hexamail to your existing email server, you need to switch the IP Addresses of the machines. This can be done in the network settings of your email server machine. You may need to reboot the machines after this change for the change to take effect. NOTE: during the process of rebooting there will be a very short period where you cannot receive emails. It is recommended that you perform this task at a period when email traffic is low, for example first thing in the morning, last thing at night or over a weekend.







Running with non SMTP email client software



With some messaging solutions, outgoing email is not sent to the mail server using SMTP. Particular examples include:
  • Using Exchange Client, or Microsoft Outlook and sending emails through MS Exchange
  • Using Notes Client and sending emails through Lotus Notes

In all such cases, setting up Hexamail is simple. You need to tell Hexamail how to send outgoing SMTP email through your existing smart host, and then instruct your messaging server software to use Hexamail for outgoing email (usually as its smart host).



Incoming email arrives at port 25 of Hexamail, and is processed by Hexamail. Hexamail then send it to your existing email server on another port (if Hexamail and your email server are both running on the same machine), or on to another server (if Hexamail and your email server are on different machines)

Outgoing email arrives at your email server by way of some proprietary protocol from the user's email client: Notes or an Exchange client. Your email server is configured to send outgoing email through to Hexamail, on port 25. Hexamail will receive this email, determine that it is for external dispatch, and perform any outbound processing before sending it on to the configured smart host.

In Hexamail ensure that your domains are setup correctly in the SMTP Server settings, on the first page of settings. These must include all domains being served by this instance of Hexamail in order that Hexamail can distinguish between incoming and outgoing emails.

Next, locate the SMTP Relay Smart Host settings and set these to be the same as your smart host settings in your email/messaging server. Click the Apply button in the Hexamail interface.

Next, open the administration interface for your existing email/messaging server and locate the Smart host/outgoing SMTP settings. Change these to direct email to Hexamail. Restart the service if required for changes to take effect.

Another way of representing this is shown below. In this diagram the existing email server is shown as two parts, that for receiving incoming email and that for sending outgoing email. This is purely for clarity in the diagram.