Installing on Windows: wizard pages, service account, profile and the first hour
-
Written for 6.3.4. hMailServer 6.3.7 (17 October 2026), a security release, has installers that carry the .NET Desktop Runtime 10.0.13 and install it only where no .NET 10 Desktop Runtime is installed at all; at every installation and upgrade
/ProtectFoldershardens the program folder,BinandControlPanel, because in a folder that took its permissions from the root of a drive any account that could sign in to the computer could replace the programs the service runs (CVE-2026-107571; the default under Program Files was never affected); setup waitsShutdownDrainSecondsplus 90 seconds for the service's stop, where it waited plus 30; and the x64 installer's MySQL and MariaDB client is MariaDB Connector/C 3.4.11. See the 6.3.7 announcement. hMailServer 6.3.8 (2 November 2026) is the release to install today, a security release: a new server runshMailServer-6.3.8-x64.exe, Authenticode-signed and with its Sigstore bundle beside it, and a server on 6.3.4, 6.3.5, 6.3.6 or 6.3.7 installs it by the live update, with the exceptions the announcement lists. Its setup makes or hardens the program folder,BinandControlPanelbefore it copies a file or runs a program of the installation, and ends with exit code 7 where another account than SYSTEM, the Administrators and TrustedInstaller controls one of them, a folder or a link on the way to them, or a program, library or script in them (step 2 below; the four narrower cases of work item 78 that 6.3.7's notes left open); and it refuses an installation of the original hMailServer's 5.7 before it changes anything. See the 6.3.8 announcement.This topic walks through a new installation of hMailServer 6.3.4 on Windows: what the installer checks before it shows a page, each page of the wizard, the two pages 6.3.4 adds (the setting profile and the service account), what runs after the files are copied, and the first hour after it. The one thing to know first: 6.3.4 is installed by hand on every server. It carries an Authenticode signature and no Sigstore bundle, so no server's live update installs it; you download the installer, check it and run it yourself. If you already run hMailServer, read Upgrading to 6.3.4 instead.
Before you download
The installer enforces a floor rather than advising one:
MinVersion=10.0.14393andArchitecturesAllowed=x64. On anything older, or on 32-bit Windows, setup stops with "hMailServer requires Windows 10 version 1607 (build 14393) / Windows Server 2016 or later, 64-bit." It needs an administrator, because it creates a service and writes toHKLM. The .NET 10 Desktop Runtime, which the database tools need, is installed automatically when missing; 6.3.7's installers carry 10.0.13, Microsoft's security release of 13 October 2026, and install it only where no .NET 10 Desktop Runtime is installed at all, so an upgraded server keeps the one it had. RAM is guidance only: 2 GB minimum, and nothing enforces it.Decide four things first, because the wizard asks for them:
- The administrator password. At least five characters. It is the master password for the whole server, not an email password.
- The database. The wizard asks only "built-in or external". If in doubt take the built-in one; Choosing a database covers the rest.
- The kind of server it is (since 6.3.4): the setting profile, below.
- The account the service runs as (since 6.3.4):
NT SERVICE\hMailServer, unless something it would need, such as a data or backup folder outside the program folder or SQL Server with Windows authentication on the same machine, is planned for first.
Plan antivirus exclusions for
Data\,Database\andTemp\, and somewhere to keep the exported stored-secrets key, apart from the database backups.Getting the installer and checking it
Get
hMailServer-6.3.4-x64.exefrom the latest release on GitLab, or fromhttps://updates.progressiverobot.com/download/hMailServer-x64.exe. Both now give 6.3.8, the newest stable release:hMailServer-6.3.8-x64.exe, SHA-2564b9b9c3102cbed743f6c826289c54cec25c395d02208e55cdd3219187fbf8654, with its.cosign.bundlebeside it; 6.3.4's own files are on its release page.6.3.4 carries no
.cosign.bundle. It was built and Authenticode-signed by hand, after GitHub suspended the project's account on 18 September 2026 and before the project's GitLab CI signing job existed. Its SHA-256 sums are in a file signed with the release tags' SSH key: the 6.3.4 announcement has the two commands that check a download against it. Then check the installer's own signature:Get-AuthenticodeSignature .\hMailServer-6.3.4-x64.exe | Format-List Status, SignerCertificateStatusmust beValid, and the signer's subject names Progressive Robot Ltd. SmartScreen still warns: expect Windows protected your PC with the publisher's real name on it.winget install hMailServerandchoco install hmailserverdo not install this fork (Unattended installs, winget and Chocolatey).What the installer checks before it shows a page
Choose Run as administrator.
InitializeSetup()runs first:Check Result /adminpassword, orHM_ADMIN_PASSWORD(since 6.3.4), shorter than 5 charactersSetup stops A window titled hMailServer Control Panel, hMailServer Administrator, hMailServer Database Setup, hMailServer Database Upgrader or DBSetup is open Setup stops: "…You must close down this application before starting the installation." Ports 25, 110 or 143 in use while the hMailServer service is not running Warning only: "…This indicates that there already is an email server running on this computer." Ignore the port warning and two servers will fight over port 25.
The wizard, page by page
- Licence agreement. hMailServer is AGPL-3.0.
- Destination folder.
C:\Program Files\hMailServeris fine. Since 6.3.7 setup's/ProtectFoldershardens the program folder,BinandControlPanelat every installation and upgrade: in a folder that took its permissions from the root of a drive, any account that could sign in to the computer could replace the programs the service runs (CVE-2026-107571, every version from 6.0.0 to 6.3.6); the default folder under Program Files was never affected. Since 6.3.8 setup makes or hardens them before it copies a file or runs a program of the installation: one of them, a folder or a link on the way to them, or a program, library, script or settings file in them, that another account than SYSTEM, the Administrators and TrustedInstaller controls, and a program folder on a share or on a volume that keeps no permissions, end the installation with exit code 7, each named with theicaclsthat deals with it and, where setup says so, a restart of Windows before it runs again (ServiceAccount.md). - Components.
serveris the mail server, the database tools and the DB scripts.controlpanelis the administration application; without it you have no GUI.admintools, Remote administration support, registers the COM type library on a machine that is not the server, for your own scripts; the Control Panel does not need it. - Database type. Use the built-in database engine unless you decided otherwise. If you choose external,
DBSetup.exeruns after the file copy and asks for the engine, host, database name and credentials. Skipped when[Database] Typeis already set: an upgrade never re-asks. - Start menu folder.
- Administrator password. Minimum five characters; the two boxes must match. Since 6.3.4 a space, a double quote or a backslash reaches the database step as typed: the installer has the server store the password as PBKDF2 and hands it to the database tools in the environment variable
HM_ADMIN_PASSWORD, never on a command line. Set one. While the value is empty,COMAuthentication::AttempAnonymousAuthenticationgrants server-administrator rights to any COM caller andRestApiServer::Startrefuses to start the REST API. - Server profile (since 6.3.4), on a new installation only.
- Service account (since 6.3.4).
- Ready to install. Pressing Install stops an existing hMailServer service and waits
ShutdownDrainSeconds + 30seconds for it (since 6.3.7,ShutdownDrainSecondsplus 90). If it will not stop, setup refuses to go on: "The hMailServer service did not stop within 30 seconds." Stop it inservices.mscand run setup again; do not work around this. - Install.
The setting profile page (since 6.3.4)
A setting profile is the thirty or so settings that make a server a particular kind, named. The wizard offers four, with None (the shipped settings) chosen until you pick another:
Profile For officeOne server that receives an office's mail, holds its mailboxes and sends what its people write: SPF, DKIM, DMARC and greylisting on, spam held in the quarantine, auto-ban and account lockout, a password policy and the breach check gatewayA server behind a filtering gateway that has already judged the mail: greylisting off, and XCLIENT and an ARC seal trusted only from the addresses and the sealer you name; putting the gateway's addresses in Incoming relays is yours to do (Behind a gateway) relayAn outbound relay that holds no mailbox anybody reads: IMAP and POP3 closed, hard bounces suppressed, deliveries throttled per destination, every message traced senderThe relay's shape for a high-volume sender judged on its bounce and complaint rates After the database step the installer runs
hMailServer.exe --apply-profile NAME --once --if-new --confirm;--if-newleaves alone a database that already holds ten accounts or more. Every failure is said, naming the profile as not applied, and the installation succeeds with the shipped settings. In the wizard no difference is shown: each profile's sentence names the listener, the filter or the trust it changes, and choosing it is the confirmation, sorelayandsenderclose IMAP and POP3 with no further question. Chosen later, from the Control Panel's Setting profiles page or the Control Deck's checklist, a profile shows its difference from this server before it changes anything. Either way it saves what it replaces and can be put back. A profile never sets a port, a directory, a[Database]value, a password or an IP range's Require SSL/TLS when authenticating. One caution from Profiles.md: the installer page is among what it lists as "written and read, and not run", because "the installer was not built for this change".The service account page (since 6.3.4)
Until 6.3.4 the Windows service ran as LocalSystem, so a flaw reachable through SMTP, IMAP or POP3 was a flaw with full control of the computer. A new installation now runs it as
NT SERVICE\hMailServer, the service's own virtual account: no password, no account to create, and it reaches only the folders it is granted.The machine The page offers The default No hMailServer service yet NT SERVICE\hMailServer, or LocalSystemNT SERVICE\hMailServerA service running as LocalSystem keep LocalSystem, or move it keep LocalSystem A service running as any other account keep that account, or move it back to LocalSystem keep the account An upgrade never changes the account unless this page is answered to.
What the account is granted, by
hMailServer.exe /GrantServiceAccess: Modify on the program folder's ownData,Logs,TempandDatabase; Read on its other folders; Modify onBin\hMailServerApiKeys.ini; nothing onhMailServer.INI; and a folder the configuration names elsewhere only once an administrator approves it. An attended installation asks (--confirm). A silent one approves nothing: when the configuration names a folder or key file outside those folders, it leaves the service on LocalSystem, working, and says why.The folders and the certificate and key files the configuration names are checked against those grants and reported:
NOT APPROVED, a folder nobody has approved;OUTSIDE, a certificate or key file, which is never given Read where it is (move it intoData\Certificates, or approve its folder for Read);REFUSED, a folder that may never be granted. A folder is approved with--approve-modify "<folder>"or--approve-read "<folder>", or by answering Yes to--confirm; approvals are kept inHKEY_LOCAL_MACHINE\SOFTWARE\hMailServer\ServiceAccessPaths, a key only Administrators and SYSTEM may change. Approve only a folder you recognise: the service may then write in it. Never granted, approved or not: anything not a full path on a fixed local drive; a drive's root; the program folder, a folder above it, or anything in it but itsData,Logs,TempandDatabase; the Windows folder, a Program Files folder, the user profiles folder orProgramData\Microsoft, or any folder in or above one of them;ProgramDataor a folder above it (a folder of your own inside it may be approved); and any path through a junction, a symbolic link or a mount point.--report-onlysays what would be done and changes nothing. Exit codes:0every grant made and everything named reached, or confirmed,1a grant or an approval failed,2not in an installation'sBin,3not elevated,4something outside not confirmed,5a folder that is never granted is named,6answered No.What only LocalSystem could do is refused with a sentence: the live update's apply (the update is still checked; on 6.3.4 and 6.3.5 an administrator downloads the installer from the release page, checks its signature and runs it, and from 6.3.6 installs the verified update with Install update on the Control Panel's Server status page on the server, with one Windows prompt), the auto-ban's Windows Firewall rules (
AutoBanFirewall, HM7460; banned addresses are still refused by the server) andUtilities.MakeDependent. SQL Server with integrated authentication on the same machine needs a login first:CREATE LOGIN [NT SERVICE\hMailServer] FROM WINDOWS, then a user withdb_owner. MySQL, MariaDB and PostgreSQL use a user and password, and nothing changes.hMailServer.INIis read-only to the service. A change of the administrator password over COM or the Control Panel's Administrator password card is refused; make it from an elevated prompt inBinwithhMailServer.exe --set-admin-password, which takes the password fromHM_ADMIN_PASSWORDor, failing that, from standard input, and restart the service (ServiceAccount.md writes it/SetAdministratorPassword). Enrolling the administrator's TOTP second factor needs an account that may write the file, so move the service to LocalSystem for the enrolment and back.To move a service that runs as LocalSystem, run the installer again and choose the move, use the Control Panel's Windows service account card under Server limits & expert settings, or, from an elevated prompt in
Bin:hMailServer.exe --confirm /GrantServiceAccess hMailServer.exe --service-account virtual /Register net stop hMailServer && net start hMailServerrunning the second line only when the first ended in
0. To go back, run the installer again and choose Move it back to LocalSystem, use the same card, or runhMailServer.exe --service-account localsystem /Registerand restart the service. ServiceAccount.md records that the live registration "is exercised by hand on a throwaway machine; nothing here registers a service on the bench".What runs after the files are copied
# Step What runs If it fails 1 .NET 10 Desktop Runtime Only when missing; since 6.3.4 pinned to 10.0.12 by version and SHA-512; 6.3.7 carries 10.0.13 and installs it only where no .NET 10 Desktop Runtime is installed at all Error dialog; exit codes 0,3010and1638count as success2 Database backend SSCERuntime_x64-ENU.msi, built-in engine onlyStep 4 is skipped 3 Create the service hMailServer.exe --service-account <choice> /Register; a service to be moved is registered as LocalSystem hereStep 5 is skipped 3a Administrator password (since 6.3.4) hMailServer.exe --set-admin-passwordThe install fails 4 Create the database DBSetupQuick.exefor the built-in engine,DBSetup.exefor an external one chosen for the first timeThe install fails, naming the exit code 4a Secure a new installation (since 6.3.4) hMailServer.exe --apply-new-install-defaultsSaid and logged; the installation succeeds 4b Apply the profile (since 6.3.4) --apply-profile, aboveSaid; the shipped settings stay 4c Stored-secrets key (since 6.3.4) hMailServer.exe --create-stored-secrets-keySaid, with the command to run by hand 4d Move the service (since 6.3.4) /GrantServiceAccess, and only when that ends in 0,--service-account virtual /RegisterThe service stays on LocalSystem, working 5 Start the service net START hMailServer, the verdict taken from the SCM"The hMailServer service was installed but did not start." The database step runs while the service is still LocalSystem, because it writes
[Database]intohMailServer.INIthrough the service, which the virtual account may not do.ServiceMainreportsSERVICE_RUNNINGbefore it connects to the database, so a running service proves the process started, not that the schema is usable; step 4's exit code covers the schema.What a new installation starts with (since 6.3.4)
Step 4a runs
hMailServer.exe --apply-new-install-defaultsafter the database step, before the server first listens, and only on a database this installation created: on oneDBSetup.exeattached the verb exits 5, which the installer only logs, and the installation succeeds. On a created database, ports 25, 587, 110 and 143 offer STARTTLS with a self-signed certificate that mail clients warn about, and the Internet IP range requires TLS for authentication, so a client on another machine must start TLS before it signs in; an upgraded server is left as it was. What each default is, how to replace the certificate (Let's Encrypt certificates are automatic) and how to apply the defaults by hand are in Hardening a public mail server.The stored-secrets key (since 6.3.4)
On a new installation step 4c makes the key that seals each account's TOTP second factor and the
[Settings]secrets in the database. It is kept in this machine'shMailServer.INIalone, never in the database or a backup, and an upgrade makes none. Export it and keep the file with the database backups, stored apart from them:# elevated, in the Bin folder .\hMailServer.exe --export-stored-secrets-key D:\keys\hmailserver-stored-secrets.keyA database restored without it opens none of those secrets. Hardening a public mail server covers the key in full: what it seals, other nodes, and a key that is lost.
Confirm it is running, and open the firewall
Get-Service hMailServershould sayRunning. On a new installation that kept the page's default,services.mscshows it logging on asNT SERVICE\hMailServer.sc.exe qfailure hMailServershows the recovery the installer set: restarts after 60, 120 and 300 seconds, the counter reset after 86400.The installer does not open firewall ports. Until you do, nothing reaches the server. One rule per port, in an elevated PowerShell; for SMTP:
New-NetFirewallRule -DisplayName "hMailServer SMTP" -Direction Inbound -Protocol TCP -LocalPort 25 -Action AllowWhich ports to open, and which to leave closed, are in Every port hMailServer listens on.
The first hour: the checklist and the sample domain
Since 6.3.4 the server judges its own first hour. Twelve items, each
done,action_needed,cannot_tellornot_needed: a profile, a domain, an account, TLS on the submission port, passwords only over TLS, an SPF record, DKIM signing, a DMARC record, a backup destination, a second factor for the administrator, the stored-secrets key and the account the server runs as. It is the Control Deck's Checklist view, the head of the Control Panel's External setup page,GET /api/v1/setup/checklistand COM'sUtilities.GetSetupChecklist.A button on the Control Panel's Welcome page and on the Deck's checklist makes a throwaway sample domain,
example.test, with three mailboxes, a list, a rule and eight delivered messages; a second removes it. The server mints one password for the three mailboxes and shows it once, in the answer that makes the sample; Your first domain and mailbox has the detail. Remove the sample before the server takes real mail.Silent installation
A silent install answers the two 6.3.4 pages with
/profile=and/serviceaccount=, and leaves the administrator password unset unless/adminpassword=orHM_ADMIN_PASSWORDgives it. Always check the exit code: a failed database create fails the install. The switches, the profiles and the password are in Unattended installs.What the installer wrote
{app}\Bin\hMailServer.INIis the only configuration file. Since 6.3.4 the database is the settings store: the file keeps[Directories],[Database],[Security]and[GUILanguages], its[Settings]section is the server's copy, and a hand edit to a key the database holds is named in the error log (HM5804) and does not take effect. A service that may write the file puts the line back at the next start; underNT SERVICE\hMailServerthe copy is not refreshed and the edited line stays as you left it, so a line that survives a restart is still not the value in use.[Security] AdministratorPasswordis PBKDF2,$h1$<iterations>$<salt-hex>$<key-hex>.{app}\Data,{app}\Events,{app}\Addonsand the ini are left behind by an uninstall, on purpose.What it does not do, and where to read more
The installer does not open the firewall, does not create ports 465, 993 and 995, publishes no DNS record, and never applies the secure defaults, a profile or a stored-secrets key to an upgraded database. All of this is Windows only: the Linux packages have no wizard, no Control Panel and no COM (First install on Linux).
Sources: the wiki's Installing hMailServer and Before You Install; SecureDefaults.md, ServiceAccount.md, Profiles.md, SetupChecklist.md, SampleDomain.md and Upgrading.md; and chapters 3 and 4 of the public documentation. The release announcement is hMailServer 6.3.4: a password could run code on Windows servers with JScript scripting.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login