
HMailServer is a free, open-source email server that's perfect for small to medium-sized businesses and home users. It's highly customizable and can be set up to work with a variety of email clients and services.
To get started with HMailServer, you'll need to download and install the software on your computer or server. This is a straightforward process, and the installation package includes a wizard that guides you through the setup process.
HMailServer uses a database to store user and domain information, which is a key feature that sets it apart from other email servers. This allows for more efficient management and organization of email accounts.
The database is where you'll go to configure user settings, such as passwords and email addresses. You can also use the database to create new users and domains, as well as manage existing ones.
If this caught your attention, see: List of Email Archive Software
Installation
To install hMailServer, start by downloading the installation program from the hMailServer website. You can select the version you want to install, but for this example, we'll be using version 5.6.8.
The installation process is a wizard-based installation type, which means you'll only be clicking on buttons. You can choose to accept the default location for the installation or select a custom path.
You'll need to select the database server type, and for this example, we'll be using the built-in database engine. You'll also need to enter an administrative password for the administrative user being created by Setup. Make sure to make this password secure and don't lose it!
Here's a summary of the steps to install hMailServer:
- Download the installation program from the hMailServer website
- Launch the installation program and follow the wizard
- Select the database server type (in this case, the built-in database engine)
- Enter an administrative password for the administrative user
- Choose the destination folder and click Next
- Verify and click Install on the summary screen
After the files have been installed, you'll need to enter the password for the administration rights. This completes the installation, and you can now launch the hMailServer Administrator from the Start Menu.
Preparation
To prepare for installing and configuring hMailServer, you'll need a Windows Server 2016 computer. This is the minimum requirement to follow along with the examples in this article.
You'll also need to download the latest copy of hMailServer from the provided link. Make sure to download the correct version for your Windows Server 2016 computer.
For more insights, see: Website to Download Programs for Free
An email client is also necessary for accessing email accounts. Mozilla Thunderbird will be used in this article, but you can use any email client you prefer.
You may also need an Active Directory if you plan to create hMailServer email users based on Active Directory users. However, this is optional and not required for basic functionality.
A valid SSL certificate is also optional, but highly recommended for encrypting email client connections. If you don't have one, you can get a free SSL certificate from Let's Encrypt in PEM format.
A different take: Email Migration
Preparing Your Environment
To prepare your environment for hMailServer, you'll need a Windows Server 2016 computer.
You'll also need to download the latest copy of hMailServer from the official website.
An email client is necessary for accessing email accounts, and Mozilla Thunderbird will be used in this walkthrough.
Active Directory is optional, but recommended if you plan to create hMailServer email users based on Active Directory users.
A valid SSL certificate is also optional, but recommended for encrypting email client connections. Let's Encrypt offers free SSL certificates in PEM format.
Here's a summary of the required software and hardware:
Adding Domains
Adding domains is a crucial step in setting up hMailServer. You need to add an email domain before you can create users.
Just installing hMailServer isn't enough, you still need to configure domains, users, ports, and relay settings. Adding a new domain requires you to click on Domains in the admin console window, which should be empty initially.
To add a new domain, type in your domain in the Domain box and make sure the Enabled checkbox is checked. Click Save to create the new domain.
After adding a new domain, you can configure more settings like message size limits and default signatures if you prefer.
Security and Encryption
HMailServer's security can be improved by adding an SSL certificate for authentication and encryption. This is crucial for protecting email traffic, especially for professional business email accounts.
To secure email traffic, you'll need to obtain an SSL certificate from a trusted Certification Authority (CA) like DigiCert, SSLS.com, or CheapSSLSecurity.com. The certificate should be in the PEM format, compatible with hMailServer.
You'll need to add the SSL certificate to hMailServer by going to Settings -> Advanced -> SSL Certificates and clicking 'Add...'. Then, type in the certificate's 'Subject Name', browse to the 'Certificate file' and 'Private key file', and click Save.
To use the secure ports, you'll need to bind the SSL certificate to them. In the Advanced section, browse to 'TCP/IP ports' and add a new entry for each secure port: IMAP (993), POP3 (995), and SMTP (465). You'll need to select the SSL Certificate from the list for each port.
Here are the required ports for secure email transfer:
- IMAP: 993 (SSL/TLS)
- POP3: 995 (SSL/TLS)
- SMTP: 465 (SSL/TLS)
By following these steps, you'll be able to secure your email traffic and protect your email account from unauthorized access.
Is Secure?
hMailServer is not secure out of the box, with default ports like 110 (POP3), 25 (SMTP), and 143 (IMAP) being insecure.
To gain secure transfer of email, you'll need to add an SSL certificate and create new bindings in the software. This will allow secure email transfer via ports 995 (POP3 SSL), 465 (SMTP SSL), and 993 (IMAP SSL).
The security of hMailServer depends on the steps taken during its initial setup, installation, and configuration. A 3rd-party SSL certificate is highly recommended for the hostname of your new hMailServer before sending or receiving emails.
To add an SSL certificate, you'll need the PEM format certificate file and key available.
Here are the required ports to be allowed in your network for secure email transfer:
- 25 (SMTP)
- 465 (SMTP SSL/TLS)
- 587 (SMTP Submission)
- 110 (POP3)
- 995 (POP3 SSL/TLS)
- 143 (IMAP)
- 993 (IMAP SSL/TLS)
You should also set up DNS records, including MX records, A records, and maybe even a CNAME record, to facilitate other email servers routing your email to your hMailServer.
Network and Ports
To set up hMailServer, you'll need to make sure certain ports are open on your server and in your firewall-protected network. This includes ports 25 (SMTP), 465 (SMTP SSL/TLS), 587 (SMTP Send), 110 (POP3), 995 (POP3 SSL/TLS), 143 (IMAP), and 993 (IMAP SSL/TLS).
You'll also need to create some DNS records on the Internet to facilitate other email servers routing your email to your hMailServer. This includes MX records, A records, and possibly a CNAME record.
Here are the ports you'll need to open on your edge router or firewall to allow outgoing traffic to flow between your hMailServer and the Internet:
- 465 (Secure SMTP)
- 995 (Secure POP3)
- 993 (Secure IMAP)
Releasing
Releasing a new version of a network server requires careful testing to ensure stability and security.
Before releasing, you should run all integration tests on supported versions of Windows and the different supported databases.
Running all server stress tests is also crucial to identify any potential issues under heavy loads.
Enabling Gflags and running integration tests can help detect memory issues that might not be apparent otherwise.
You should also run the server for at least a week in production to catch any issues that might not be apparent in testing.
Finally, waiting for at least 500 downloads of the beta version can help ensure that any issues are caught by a large enough user base.
Network and Port
To set up your network and port requirements, you'll need to make sure certain ports are open on your server and in your firewall-protected network.
The following ports need to be open: 25 (SMTP), 465 (SMTP SSL/TLS), 587 (SMTP Send), 110 (POP3), 995 (POP3 SSL/TLS), 143 (IMAP), and 993 (IMAP SSL/TLS).
You'll also need to set up DNS records, including MX records, A records, and possibly a CNAME record, to allow other email servers to route your email to your hMailServer.
Here's a list of the required ports:
- 25 (SMTP)
- 465 (SMTP SSL/TLS)
- 587 (SMTP Send)
- 110 (POP3)
- 995 (POP3 SSL/TLS)
- 143 (IMAP)
- 993 (IMAP SSL/TLS)
To allow outgoing traffic to flow between your hMailServer and the Internet, you'll need to open the following ports on your edge router or firewall: 465 (Secure SMTP), 995 (Secure POP3 – If needed), and 993 (Secure IMAP).
Here's a comparison of the required ports:
Note that you may not need to open all of these ports, depending on your planned usage.
Database and Users
Database requirements for HMailServer are straightforward. You can use SQL Server Compact Edition (CE) for testing and non-commercial use cases, but for commercial email servers, you'll need to choose from MySQL 4 & 5, MSSQL (Microsoft SQL Server 2000, 2005, and 2008), PostgreSQL 8, or a supported version of Microsoft's SQL Server like SQL Server 2019, 2017, or 2016.
To ensure compatibility, make sure you have the .NET Framework 2.0 installed, which can be done by installing the .NET Framework 3.5 Feature through PowerShell.
Here are the supported database engines for HMailServer:
- MySQL 4 & 5
- MSSQL (Microsoft SQL Server 2000, 2005, and 2008)
- PostgreSQL 8
- SQL Server 2019
- SQL Server 2017
- SQL Server 2016
Now that your database is set up, you can start adding users to your HMailServer.
Database
For your email server to work, you'll need to set up a database engine. You have a few options to choose from, including MySQL 4 & 5, MSSQL (Microsoft SQL Server 2000, 2005, and 2008), and PostgreSQL 8. You can also use a supported version of Microsoft's SQL Server, such as SQL Server 2019, 2017, or 2016.
Consider reading: Microsoft Exchange Server

To narrow down your choices, consider the following: if you plan to create a commercial email server, you'll need to choose one of these external database engines. If you're looking for a testing or non-commercial solution, SQL Server Compact Edition (CE) might be sufficient.
Here are some database engine options to consider:
- MySQL 4 & 5
- MSSQL (Microsoft SQL Server 2000, 2005, and 2008)
- PostgreSQL 8
- SQL Server 2019
- SQL Server 2017
- SQL Server 2016
In addition to choosing a database engine, you'll also need to make sure you have the .NET Framework 2.0 installed. Thankfully, you can install the .NET Framework 3.5 Feature, which includes .NET 2.0 and 3.0.
Adding Users
You can add new users to hMailServer by clicking on the Account folder under the domain and then clicking on the Add button on the right.
To add a new account, you'll need to specify the First name and Last name of the new user on the Advanced tab.
There are two ways to create a user in hMailServer: by manually creating a user and then integrating it with Active Directory, or by directly creating a user from an existing Active Directory user object.

To create a user from Active Directory, right-click on the Accounts folder and click on Add AD Account.
Select the domain from the dropdown list and then choose the user you want to create an email account for from the list of users.
You can also integrate hMailServer with your local Active Directory to ease the administrative burden of managing accounts and passwords.
To do this, click on the account and click the Active Directory tab, then check the box next to Active Directory account and enter the AD domain and username.
Alternatively, you can right-click on the Accounts folder and choose Add AD account to add an existing AD user into hMailServer.
Additional reading: List of Free and Open-source IOS Applications
Active Directory and Authentication
You can integrate hMailServer users with Active Directory to allow them to log in with their domain credentials. This is done by locating and editing the user account in the admin console and checking the Active Directory account box.
To integrate an existing user with AD, you'll need to enter the Active Directory domain and the user name in the respective boxes. This ensures that users can access their email accounts using their AD credentials.
You can also create a new user in hMailServer directly from an existing Active Directory user object. To do this, right-click on the Accounts folder and select Add AD Account. This will create a new user in hMailServer based on the AD user account.
The Active Directory tab in the admin console is where you'll find the settings for integrating users with AD. From here, you can enter the AD domain and user name to connect the user's account.
By integrating hMailServer with Active Directory, users can use their AD domain credentials to access their email accounts, making it easier for administrators to manage accounts and passwords.
Here's an interesting read: Accounts & SSO
DNS and SMTP
To get hMailServer up and running, you'll need to configure your DNS settings. This involves setting up external DNS records to point to your hMailServer's external IP address. An MX record is a record that tells how to deliver an email to a specific domain, and you'll need to point it to your hMailServer's external IP address.
You'll also need to set up an external A record, which tells DNS servers what IP address is associated with your hMailServer's external hostname. Your network administrators can assign an external IP address for your hMailServer, and a common scenario is having a 'one to one' NAT setup on your edge firewall.
For internal DNS records, you'll need to set up an A record for your hMailServer's hostname pointing to its internal IP address. This is the simplest setup, but you can do additional research on more sophisticated DNS configurations.
To allow for inbound email traffic from the Internet, you need to specify a public hostname of the computer you installed hMailServer on. You do this via Settings -> Protocols -> SMTP, and you'll need to make sure you have an external DNS A record for that hostname to point to the external IP address of your server.
You can check if your server has the ability to send on port 25 or not by entering a command in a command prompt/Terminal. If you can't send email directly from the server, you can use an SMTP relay to send emails to your ISP's email server.
Here are the basic DNS record requirements:
- Internal DNS: A record for the FQDN of the server where hMailServer will be installed
- External DNS: MX record for mail delivery, and a CNAME record for client connection (IMAP, POP3, SMTP)
If you have a perimeter SMTP service, you can configure hMailServer to use it as a smart host for delivering external messages. This involves setting up an SMTP relayer or smart host in the hMailServer admin console, and entering the name of your hMailServer that is published in your public DNS record.
You can use a perimeter email server to send emails to external domains, and this can be a good option if you have such services available. To configure an SMTP relayer or smart host, follow these steps in the hMailServer admin console: Settings -> Protocols -> SMTP, then select the Delivery of e-mail tab and enter the name of your hMailServer and the SMTP relayer settings.
Testing and Verification
To confirm if the SMTP smart host configuration is working, you should test external email delivery.
Sending an email to an external domain, such as gmail.com, and verifying that the message was delivered is a good starting point.
This can be done by sending a message from an hMailServer user, like [email protected], to a recipient at the external domain.
If the message is received successfully, replying to it will confirm that the reply was delivered back to the hMailServer user mailbox.
You can see this process in action by checking the email screenshot in the example, which shows a message received by the gmail.com recipient and a reply delivered back to the hMailServer user mailbox.
Additional reading: Message Transfer Agent
Frequently Asked Questions
What is the use of hMailServer?
hMailServer is a free, open-source email server for Windows, used globally by Internet service providers, companies, and individuals. It enables email services and integrates with web mail systems via IMAP, SMTP, and POP3 protocols.
Is hMail still supported?
Active support and development for hMail were halted in January 2022, but critical bug fixes will continue for version 5.6. For more information on the current status and available updates, please see our support page.
Featured Images: pexels.com


