How to run PostMount as a Windows service

App or service: which one you need

From the Microsoft Store PostMount installs as a regular app: it starts when you sign in to Windows, lives in the notification area and runs its mail servers while your session is open. For one person working on their own computer that is all you need.

A Windows service is for computers that work for others:

  • a PC or virtual machine that relays scans from multifunction printers and must work at night and after updates;
  • an accounting, ERP or monitoring system that sends mail through the SMTP relay and can’t wait for someone to sign in;
  • a terminal server or shared computer where different people sign in and out;
  • any computer that restarts on its own (Windows Update, power loss) and must be back on mail without anyone touching it.
App (default)Windows service
Startswhen the user signs inwith Windows, before anyone signs in
Runs asthe signed-in userthe system account (SYSTEM)
Settings and sign-inin the user profile%ProgramData%\PostMount, SYSTEM and administrators only
Managed fromthe appthe same app, as the service’s control panel
Installed byMicrosoft StoreMicrosoft Store + one administrator script
UpdatesMicrosoft StoreMicrosoft Store; the service follows by itself

How the service works with the Store app

There is no separate “server edition”: the service is the same PostMount, started in another way. The Microsoft Store does not allow apps to install services, so an administrator adds it with a script. Everything the script needs is already inside the app, so it stays small and doesn’t change between versions.

  • The script copies the installed app to %ProgramFiles%\PostMount Service\<version> and registers the PostMount service (automatic start, restart on failure).
  • Your mailboxes, gateway settings, license, the mail queue and the Microsoft 365 sign-in move to the service, so mail apps keep the same server, ports and passwords.
  • The PostMount app notices the service and becomes its control panel: it no longer runs its own servers, but shows the service’s status and log and changes its settings. On a computer without the service the app never mentions it.
  • When the Microsoft Store updates the app, the service copies the new version and restarts itself within an hour. You don’t run the script again.

Before you start

  • PostMount 1.0.28 or newer from the Microsoft Store, already set up: signed in, mailboxes added. The script moves these settings to the service.
  • Administrator rights. You can run the script as a regular user and type an administrator’s credentials in the Windows prompt — the settings of the user who started the script are moved, not the administrator’s.
  • A computer that stays on: the service works without a signed-in user, not without power.
  • On Windows Server, which has no Microsoft Store app, install PostMount with winget first: Microsoft Store apps on Windows Server 2025.

How to install the service

  1. Download the script: Install-PostMountService.ps1, or in PowerShell:
Invoke-WebRequest https://postmount.app/service/Install-PostMountService.ps1 -OutFile "$env:TEMP\Install-PostMountService.ps1"
  1. Run it as the user who works in PostMount:
powershell -ExecutionPolicy Bypass -File "$env:TEMP\Install-PostMountService.ps1"
  1. Confirm the Windows prompt (UAC) — with your own account if you are an administrator, or with an administrator’s credentials.
  2. The script prepares your settings, then a second window shows the installation. When it finishes, PostMount opens as the service’s control panel.

If the script was saved by a browser and Windows refuses to run it, unblock it first: Unblock-File "$env:TEMP\Install-PostMountService.ps1". In organizations where the execution policy is set by Group Policy, -ExecutionPolicy Bypass is ignored — an unblocked local script still runs under RemoteSigned.

How to check that the service works

  • In PostMount open Monitor: the Windows service card shows a green dot, the version and when the service started. Below it are the servers and ports — the same as before.
  • On the same page, select Check in the Mailbox check card: it sends and receives a test message over SMTP, IMAP and POP3 through the service.
  • From PowerShell: Get-Service PostMount shows Running, and Get-NetTCPConnection -State Listen -LocalPort 143,587 shows the listening ports.

In our test on Windows 11 the service started 19 seconds after Windows booted, signed in to Microsoft 365, checked the license and opened IMAP 143, POP3 110 and SMTP 25/587 — nine minutes before anyone signed in.

Settings, sign-in and who can manage the service

Everything is configured in the PostMount window, exactly as before: mailboxes, the mail gateway, network access, local passwords. Changes go straight to the service; when ports or network access change, it restarts its servers for a moment. Restart servers on the Windows service card does the same by hand.

Microsoft 365 sign-in

Sign in in the PostMount window as usual — the sign-in is handed to the service, and from then on the service renews its tokens itself, with nobody signed in to Windows. Microsoft refresh tokens are valid for 90 days and are replaced every time they are used, so a service that runs all the time stays signed in. You will be asked to sign in again only when Microsoft 365 requires it: a Conditional Access sign-in frequency policy, a password reset, sessions revoked by an administrator, or the service being off for more than 90 days. PostMount shows that a new sign-in is needed, the service log records it, and mail apps get a clear authentication error rather than silence.

The silent sign-in with the Windows account (WAM) belongs to the user’s session and can’t be handed to a service. If PostMount was signed in that way, sign in once more in its window after installing the service.

Who can manage the service

The service’s settings and sign-in are kept in %ProgramData%\PostMount, readable only by the system and administrators. The PostMount window talks to the service through a local channel that only these accounts may open: the user who installed the service, the administrator who confirmed the prompt, and members of the Administrators group. Anyone else sees “This account is not allowed to manage the PostMount service”. To allow another account:

powershell -ExecutionPolicy Bypass -File .\Install-PostMountService.ps1 -GrantUser "CONTOSO\anna"

Updates

Update PostMount in the Microsoft Store as usual. About two minutes after it starts, and then every hour, the service looks for a newer version of the app, copies it next to the current one, switches over, restarts and removes the old copy. Your settings, sign-in and ports stay as they were. The control panel shows “Updating to version …” while this happens.

Network access and the firewall

By default the servers accept connections only from this computer. To let printers, scanners or other computers in, choose Local network or Allowed IP addresses in Settings. The installation adds a Windows Firewall rule PostMount Service bound to the service itself (domain and private networks); who may actually connect is still decided by PostMount. On computers managed with Group Policy see also the administrative templates.

How much memory the service uses

Measured on the same Windows 11 computer after the app or service had settled (working set / private memory):

How PostMount runsWorking setPrivate memory
App, notification area only105 MB33 MB
Windows service76 MB23 MB
Control panel, notification area only91 MB32 MB
Control panel with the window open239 MB155 MB

The service on its own is lighter than the app: it has no window or tray icon. Most memory goes to an open window, in any mode. If the panel is only needed for changes, turn off its autostart in Settings and open PostMount when you need it — the service keeps working.

How to remove the service

powershell -ExecutionPolicy Bypass -File .\Install-PostMountService.ps1 -Uninstall

The script stops and removes the service, its firewall rule and %ProgramFiles%\PostMount Service, and gives the settings back to the PostMount app of the user who ran it: mailboxes, gateway and local passwords — mail apps keep working with the same passwords. The previous settings of that user are kept as a backup copy next to them. Sign in to Microsoft 365 in PostMount once more: the service’s sign-in can’t be moved back.

The service data stays in %ProgramData%\PostMount in case you install it again. To delete it as well, add -RemoveData.

Script parameters

ParameterWhat it does
(none)Installs the service and moves the current user’s settings to it
-User "DOMAIN\name"Also allows these accounts to manage the service (can be repeated)
-NoMigrateInstalls the service with empty settings — sign in and add mailboxes in the panel
-GrantUser "DOMAIN\name"Only allows one more account to manage an installed service
-UninstallRemoves the service and returns the settings to the app
-Uninstall -RemoveDataAlso deletes the service data

Common problems

What you seeWhyWhat to do
The script doesn’t start: “running scripts is disabled” or “not digitally signed”Execution policy, or the file still has the downloaded-from-internet markUnblock-File the script and run it with -ExecutionPolicy Bypass as shown above
“The service needs 1.0.28 or newer”An older version of the app is installedMicrosoft Store → Library → Get updates, then run the script again
“This account is not allowed to manage the PostMount service”The panel was opened by another Windows userAn administrator runs the script with -GrantUser
“The PostMount service is stopped”Stopped by hand or failed to startStart it in Services (services.msc); details in %ProgramData%\PostMount\app.log (administrators)
PostMount asks to sign in after installing the serviceThe app had signed in with the Windows account (WAM), which can’t be handed overSign in once in the PostMount window — the service keeps the sign-in from then on
Mail apps stopped connecting after the service was installedAnother program took the port first, so the service chose the next free oneCheck the ports in Monitor; free the standard port or update the app’s settings

Questions

Do I need the service?

Only if mail must keep working when nobody is signed in to Windows — scanners at night, a server, a computer that restarts by itself. For one person on their own PC the app is enough.

Is the service a different program or license?

No. It is the same PostMount from the Microsoft Store with the same license; the computer is counted once.

Does the service work before anyone signs in to Windows?

Yes. It starts with Windows, signs in to Microsoft 365 with the stored sign-in and opens its ports — in our test 19 seconds after boot.

How often do I have to sign in again?

Usually never: the service renews its tokens itself. Microsoft 365 asks again after a password reset, revoked sessions, a sign-in frequency policy or more than 90 days without the service running.

How is the service updated?

Through the Microsoft Store: when the app is updated, the service picks up the new version by itself within an hour.

Can I go back to the regular app?

Yes — run the script with -Uninstall. Settings and local passwords return to the app; sign in to Microsoft 365 once more.


Sources