hMailServer is a free, open-source SMTP, POP3 and IMAP mail server for Windows, aimed at small businesses, labs and admins who want to host their own mailboxes on a Windows box instead of renting them. If you came here for an hMailServer download, the short version is: it runs as a Windows service, stores its settings in a SQL database, and gives you a desktop admin console plus a COM API you can script against.
The project was quiet from 2021 until September 2026, when releases resumed with version 5.7. The 5.7 line is 64-bit only, adds TLS 1.3, DMARC checking and stronger password hashing, and 5.7.1 closes a script-injection hole in event scripts. Anything older than 5.7 is now listed as a legacy release and is no longer supported, so existing 5.6 servers should be planned for upgrade.
hMailServer at a glance
| Item | Details |
|---|---|
| Latest version | 5.7.1 build 3116 (29 September 2026); 5.7.2 build 3124 is a pre-release |
| Licence | Free and open source (AGPL-3.0) |
| Platforms | Windows only, 64-bit (Windows 7 SP1 to 11, Windows Server 2008 R2 to 2022 per the 5.7 requirements) |
| Developer | Martin Knafve and the hMailServer project |
| Official website | hmailserver.com |
| Best for | Self-hosted mail for small offices, test environments and application mail relays on Windows |
What it does
- Runs SMTP, POP3 and IMAP services for any number of domains, accounts, aliases and distribution lists.
- Stores configuration and message index in MySQL/MariaDB, Microsoft SQL Server, PostgreSQL or a bundled SQL Server Compact database.
- Supports SSL/TLS on all protocols, with TLS 1.3 added in 5.7.
- Filters spam with SPF, DNS blacklists, greylisting and DKIM verification; 5.7 adds DMARC policy checks.
- Signs outgoing mail with DKIM, including domain aliases and bounce messages in 5.7.
- Hands messages to an external antivirus scanner such as ClamAV.
- Exposes a COM API and event scripts (VBScript or JScript) for automation and custom rules.
- Includes a built-in backup and restore utility for settings and message data.
How sysadmins use it
Stand up a mail server for one domain
- Install, set the administrator password, then open hMailServer Administrator from the Start menu and double-click localhost.
- Click Add domain, enter your domain (for example
example.com) and save. - Under Domains > your domain, click Add account for each mailbox.
- Go to Settings > Protocols > SMTP > Delivery of e-mail and set the public host name (for example
mail.example.com). Many receiving servers reject mail without a sensible HELO name. - Publish MX, SPF and DKIM records in DNS, and ask your provider for a PTR record that matches the host name.
Script account creation through the COM API
Useful for onboarding scripts or migrating users from another system. Run it in 64-bit PowerShell on the server, because 5.7 is 64-bit only.
$app = New-Object -ComObject hMailServer.Application
$null = $app.Authenticate("Administrator", "<admin password>")
$domain = $app.Domains.ItemByName("example.com")
$acc = $domain.Accounts.Add()
$acc.Address = "jane@example.com"
$acc.Password = "<initial password>"
$acc.Active = $true
$acc.MaxSize = 2048 # MB
$acc.Save()Upgrade or deploy unattended
The installer is built with Inno Setup and accepts the usual silent switches plus an admin password, which it needs to upgrade the database:
hMailServer-5.7.1-B3116-x64.exe /VERYSILENT /SUPPRESSMSGBOXES /ADMINPASSWORD=<password> /LOG="C:hms-setup.log"- Back up first via Settings > Utilities > Backup and copy the database.
- Check the installer exit code; a running service does not prove the database upgrade succeeded.
- If the error log says the database is too old, run
"C:Program FileshMailServerBinDBUpdater.exe" /silent password:<password>.
Use it as an internal relay for apps and devices
- Create a dedicated account for printers, scanners or monitoring tools to authenticate with.
- Under Settings > Advanced > IP Ranges, keep relaying to external addresses restricted to authenticated clients; never allow unauthenticated relay from the internet range.
- If your ISP blocks outbound port 25, configure a smarthost under Settings > Protocols > SMTP > Delivery of e-mail.
Install and first run
Windows (64-bit only). The 5.7 requirements list Windows 7 SP1, 8.x, 10 and 11, and Windows Server 2008 R2, 2012, 2016, 2019 and 2022. Run the installer as an administrator. New 5.7 installs run the service as Network Service and keep data and logs under C:ProgramDatahMailServer.
Database choice. The bundled SQL Server Compact database is fine for a lab, but the documentation limits it to 4 GB and to personal, non-commercial installs, and Microsoft does not support it on Windows 8 and later. For production, point hMailServer at MySQL/MariaDB, SQL Server or PostgreSQL during setup; the client libraries ship with the installer.
Ports and firewall. Open only what you use: 25 (inbound mail), 587 or 465 (client submission), 993 (IMAPS) and 995 (POP3S). Add TLS ports under Settings > Advanced > TCP/IP ports and bind a certificate under SSL certificates.
New-NetFirewallRule -DisplayName "hMailServer" -Direction Inbound -Protocol TCP -LocalPort 25,587,993 -Action Allow
Test-NetConnection -ComputerName gmail-smtp-in.l.google.com -Port 25The second command tells you whether your network lets outbound port 25 through.
Limitations
- Windows only. There is no Linux or macOS build of the official project.
- No webmail, calendar, contacts or ActiveSync. Pair it with Roundcube or another webmail client if users need a browser interface.
- The admin console is a Windows desktop app; the PHPWebAdmin web console is basic and needs a PHP-capable web server.
- Support is community-based through the forum and GitHub issues.
- The September 2026 revival is very recent. Some long-time users have asked questions on GitHub about the pace and review of new code, so test each release on a staging box before rolling it out.
- 32-bit Windows is no longer supported from 5.7 onward.
hMailServer vs alternatives
MailEnable is the closest Windows alternative: its free Standard edition adds webmail and a web admin panel but drops anti-spam features that hMailServer gives you for free, such as SPF checks and greylisting. Xeams is cross-platform and strong on spam filtering, and it can sit in front of an existing server. If you are willing to run Linux, Postfix with Dovecot or a packaged stack such as mailcow gives you more modern tooling and a larger community. Microsoft Exchange makes sense only if you need its groupware and Outlook integration.
FAQ
Is hMailServer free?
Yes. hMailServer is free and open source under the AGPL-3.0, with no paid edition and no limit on domains or accounts.
Is there hMailServer for Linux or Mac?
No. The official project targets Windows only. On Linux, the usual equivalents are Postfix with Dovecot or an all-in-one stack.
Does hMailServer work on Windows Server 2022 and 2025?
Windows Server 2022 is on the official 5.7 requirements list. Server 2025 is not listed yet, so test it before you use it in production.
Is hMailServer safe and secure?
Run 5.7.1 or later. It fixes a script-injection vulnerability in event scripts. If you cannot upgrade, disable JScript execution and do not give end users access to the COM API. As with any mail server, block open relay and use TLS.
Is there a 32-bit hMailServer download?
Not for current releases. Version 5.7 dropped 32-bit support. Older 32-bit builds are kept only as unsupported legacy releases.
hMailServer vs MailEnable: which should I pick?
Pick hMailServer for a lean, scriptable SMTP/IMAP server with free anti-spam. Pick MailEnable Standard if you want webmail and calendars out of the box and can add spam filtering separately.
How do I configure hMailServer to send mail through an SMTP relay?
Open Settings > Protocols > SMTP > Delivery of e-mail, enter the relay host and port, and add credentials if the relay requires authentication.
Last checked against official sources: 1 October 2026 (developer website: hmailserver.com). Versions and licence terms change — confirm on the developer's site before deploying in production.






