Before we see how to configure hMailServer to handle remote email communication I would like to list the pre-requisites as below:
- Registered domain
- Email hosting for registered domain
Configure SMTP Relay Settings
SMTP relay settings needs to be done in order to send remote emails. When any hmailserver user sends email to external/remote email address hmailserver will connect to the SMTP server configured here which will further deliver the same to the recipient email server. External email from any hmailserver user will be sent using the same settings configured here and hence please make sure that your email hosting provider allows to relay emails using single account authentication if not ask them what settings needs to be done in order to achieve the same.
-
Launch hMailServer Administrator
-
Go to Settings >> Protocols >> SMTP
-
Click on Delivery of e-mail tab.
-
Enter number of retries e.g. 10. hMailServer will try to deliver remote e-mail this many times before giving up.
-
Enter number of minutes between every retry e.g. 15. hMailServer will try to connect remote SMTP server at interval specified here if connection with remote server fails.
-
Enter remote host name (provided by your hosting service provider).
-
Enter remote TCP port (provided by your hosting service provider).
-
Select Server requires authentication.
-
Enter username e.g. info@example.com
-
Enter password of e-mail address entered in step 9
-
Click Save button to save the settings
Configure external email account
Configuration of external email accounts is required in order to download emails from hosting server and delivery/distribute to the target recipient. There are three ways to get the emails on hosting server on behalf of each email user.
-
Individual mailbox for each user
-
Forwarder or alias for each email user
-
Catch-all account
Point number 2 and 3 have been discussed in depth here at Forwarders and Catch-all account in CPanel.
Now let’s configure hMailServer to download all emails from catch-all account and distribute them to hMailServer users:
-
Create an email account in hMailServer named after the catch-all account (if catch-all account is info@example.com then create user named “info” in hMailServer).
-
Edit the recently created account and go to “External accounts” tab.
-
Click “Add” button.
-
Configure your catch-all account here as shown in below snapshot. Don’t forget to select “Deliver to recipient’s in MIME headers” check box.
-
Save the configurations.
For individual mailboxes configure same as above for each hMailServer user except selection of “Deliver to recipient’s in MIME headers”.
So, now we are ready to test external email communication as well. Send email from any hmailserver user to remote email address and verify whether the recipient received it. Ask the recipient to reply to the email received and check if you are able to receive it.