hMailServer as an email distribution server

As per our discussion on Scenario #4 at Email server configuration scenarios, for small/medium organizations having local email distribution server makes sense because of the following benefits:

  1. No administrative over heads
  2. No High Bandwidth internet connectivity required
  3. No Dedicated hardware required
  4. All local email user’s (sitting within the premises) now don’t need internet connectivity to send emails to local as well as remote recipients. Internet connectivity only required on computer where email distribution server is installed.
  5. No internet bandwidth is used unless user sends email to remote recipients.

Scenario 4 : Email distribution server

hMailServer as an email distribution server

hMailServer can be configured to perform the role of email distribution server. Here are the steps for setting up hMailServer as an email distribution server.

  • Install hMailServer
  • Create your domain in hMailServer. Follow steps given at hMailServer Domain.
  • Create email accounts in hMailServer. Create all email accounts for all users who are accessing their emails from within the premises through hMailServer. Creating Email accounts of roaming users  depends upon whether the roaming users will access their emails directly from the hosting email server or from the hMailServer (email distribution server) installed within the premises.
    • Directly from hosting email server: If this is the case then there is no need to create email accounts of roaming users in hMailServer (email distribution server). You will need to create an SMTP route to deliver email messages from local users to roaming users.
    • From hMailServer (email distribution server): In this case you will need to create email accounts of roaming users in hMailServer (email distribution server). However in this case for roaming users to access their email messages from hMailServer, you should either have a static public IP or setup a Dynamic DNS service, so that they can reach hMailServer from the Internet.
    • In my case roaming users will access their emails directly from hosting email server and hence I am not creating roaming1@gopalthorve.com, roaming2@gopalthorve.com and roaming3@gopalthorve.com in my hMailServer installation.

hMailServer: Email Distribution Server - Domain and Local Users

hMailServer: Email Distribution Server - External Accounts.

  • Configure SMTP in hMailServer: Configure SMTP Relayer by providing SMTP server details provided by your hosting email service provider. hMailServer has the capability to deliver emails directly to recipient server by resolving MX records of the recipient domains, however in that case email rejection/spam/delivery failures occur because our dynamic/static IP address might be listed in RBLs, PBLs etc.

hMailServer: Email Distribution Server - SMTP Server

  • Create an SMTP route: When any hMailServer user send email to roaming user of the same domain that email will not be delivered to the roaming user of the same domain on hosting email server and will be rejected by hMailServer saying that “550 Unknown user”. To deliver emails from hMailServer users to roaming users created on hosting email server of the same domain we will have to create an SMTP route. To create an SMTP route follow below steps:
    • Go to Settings – Protocols – SMTP – Routes in hMailServer administrator
    • Click on Add button to create a new SMTP route.
    • General – Domain: Enter the your own domain name here e.g. gopalthorve.com.
    • General – Description: Enter description here.
    • General – Target SMTP host: Enter SMTP Server host that will be used to send messages matching this route. e.g. mail.gopalthorve.com.
    • General – TCP/IP port: Target SMTP TCP/IP port. e.g. 25
    • General – Use SSL: Select if target SMTP host requires SSL connection.
    • General – When sender matches route, treat sender as: Select “A local email address” here. Because when hMailServer will send email to roaming users of the same domain, then sender is treated as a local user.
    • General – When recipients matches route, treat recipient as: Select “A remote email address” here.

hMailServer: Email distribution server : SMTP route - General

    • Addresses – Deliver to all addresses: Select if you want to match this route for all emails sent by hMailServer users to non-existing email account in hMailServer and want to deliver these emails using target SMTP host provided in General settings. In this case any email sent to non-existing accounts on hosting email server will be rejected by hosting server saying that “There is no such user here”.
    • Addresses – Deliver to addresses below: Select this option and enter specific email addresses in the list for which you want to match and deliver email messages using this route. In this case emails sent to remote users of same domain who are not in this list will be rejected by hMailServer saying that “550 Recipient not in route list.”, so that such emails will be not be sent to target SMTP host which saves bandwidth too. Remember by selecting this options you must add any new roaming/remote email account created on email hosting server to this list in order to make successful delivery from hMailServer users to newly created email account.

hMailServer: Email distribution server : SMTP route - Addresses

    • Delivery – Number of tries: Whenever due to any reason emails matched by this route doesn’t get delivered in first try it will be held in the queue, and will be retried this many number of times for delivery. After completing all attempts hMailServer will return delivery failure notification to sender.
    • Delivery – Minutes between every retry: Interval between successive retry in minutes. After these many minutes hMailServer will re-attempt to deliver the email message held in queue.
    • Delivery – Server requires authentication: Select if target SMTP host for this route requires authentication.
    • Delivery – User name: User name for authenticating with target SMTP host.
    • Delivery – Password: Password for the user provided in previous step.

hMailServer: Email distribution server : SMTP route - Delivery

SMTP Routes can be used in many other situations e.g. deliver email to specific domain through specific target host without resolving it’s MX records etc. We discussed here one of its application for delivering emails from hMailServer to the email accounts on other server for the same domain even if the domain is created on hMailServer.

  • Enable Logging: Go to Settings – Logging to enable logs for troubleshooting purpose. Log files are created in Logs folder located in hMailServer installation folder. Log files are created on daily basis e.g. “hmailserver_2012-02-25.log”.
  • IP Ranges: For now keep IP Ranges to default created by hMailServer installation. hMailServer is by default pre-configured for high security. However we will have in depth analysis of IP ranges in future articles.

That’s all about configuring hMailServer as an email distribution server. However there are many other possibilities which can be achieved using hMailServer as an email distribution server, we will look at those as we move along.

Configure email client on Users Machines

  • Configuration Parameters:
    • Incoming (POP3) mail server: IP address or host name of the machine where hMailServer is installed.
    • Incoming (POP3) port: Default is 110 for default hMailServer installation.
    • Outgoing (SMTP) mail server: IP address or host name of the machine where hMailServer is installed.
    • Outgoing (SMTP) port: Default is 25 for default hMailServer installation.
    • Username/Password: Username is entire email address and password which assigned to hMailServer email account.
    • hMailServer SMTP will require to authenticate so remember to select “My outgoing mail server requires authentication” in email client.
  • Please refer these articles to configure email account on various email client.

Do hMailServer have any Webmail Client?

Accessing your emails through webmail client is one of the common requirement for any organization especially for roaming users/local users who don’t have any fixed device to access their emails. However hMailServer doesn’t have any inbuilt web mail client, but the good news is that we can configure any third-party web mail client application (which supports SMTP and IMAP) to support this functionality. In my next article, we will install and configure one of the widely used open source web mail client known as Roundcube. To install and configure Roundcube please visit this link Roundcube Webmail.

Related Posts

One thought on “hMailServer as an email distribution server

  1. H-mail server can be used in premises where internal communication is absolute necessary. Even in future it can be expand to external mails also. Love to know more and more about H-Mail server.

Leave a Reply