-
-
Notifications
You must be signed in to change notification settings - Fork 0
Host Your Own Email on Windows Server
You can run your own mail server on Windows, at your own domain, with real mailboxes — and the hard part is not the software. It is convincing the rest of the internet that your mail is legitimate. This page covers both.
Does your host block outbound port 25? Most cloud providers do by default — Azure blocks it outright on most subscriptions, AWS and Google require a request, and many VPS providers block it until you ask. Without outbound 25 you can receive mail but cannot send it directly, and no amount of configuration changes that. Ask your provider before you build anything, and if the answer is no, plan to relay through a service instead.
| Server | Notes |
|---|---|
| Stalwart | Modern, single binary, SMTP + IMAP + JMAP, DKIM built in, sensible defaults. This is what WinPanel installs and manages. |
| hMailServer | The long-standing free Windows option. Mature, but development is slow and it predates much of the current anti-spam landscape. |
| MailEnable | Commercial, Windows-native, free tier available. |
| Microsoft Exchange | If you are asking this question, you do not want to run Exchange. |
Sending is easy. Being believed is the job. Every one of these lives in DNS, and each one is why a message that looks perfect ends up in a spam folder.
| Record | Says | Missing means |
|---|---|---|
| MX | Where mail for this domain should be delivered | Nobody can email you |
| SPF | Which servers may send as this domain | Your mail is treated as forged |
| DKIM | A cryptographic signature on each message | No proof the message was not altered |
| DMARC | What to do with mail that fails the above | Receivers guess, and guess badly |
| PTR (reverse DNS) | This IP address really is that hostname | Many servers reject you outright |
Two more things nobody tells you:
Only one SPF record. Two TXT records both beginning v=spf1 is a permanent error and
fails everything. Merge them into one.
PTR is set by your host, not by you. It lives with whoever owns the IP address, so it is a support ticket or a control-panel field at your VPS provider — never in your own DNS.
Most mail servers issue themselves a self-signed certificate on first start and never replace it. Webmail then works fine, and Outlook and Thunderbird refuse to connect or warn on every launch — which is why "webmail works but Outlook does not" is such a common complaint.
The fix is to give the mail server the same real certificate your website uses, and to keep giving it one after each renewal. WinPanel copies the certificate Caddy obtained into the mail server at startup and every six hours, so mail clients trust it too.
| Port | For | Needed |
|---|---|---|
| 25 | Server-to-server delivery | Inbound to receive, outbound to send |
| 465 | Submission, implicit TLS | Yes — what Outlook usually picks |
| 587 | Submission, STARTTLS | Yes — Thunderbird and many networks use only this |
| 993 | IMAP over TLS | Yes, to read mail |
| 995 | POP3 over TLS | Only if something still uses POP |
587 is worth checking explicitly. Several mail servers do not bind it out of the box, and because Outlook prefers 465 everything looks fine until somebody on a network that blocks 465 cannot send at all.
- Installs and supervises Stalwart as a Windows Service.
- Creates mailboxes per domain, with storage quotas and send-as aliases — one mailbox can
answer to
noreply@,support@andinvoices@, which is what an application needs when it sends from more than one address. - Publishes the MX, SPF, DKIM and DMARC records to Cloudflare in one click, merging into an existing SPF rather than adding a second one.
- Checks all nine of the things above — outbound 25, reverse DNS, MX, SPF, DKIM, DMARC, submission ports, IMAP and the certificate — and explains each failure in plain words.
- Ships a webmail client, so a mailbox is usable the moment it exists.
WinPanel — a free control panel for hosting websites, Node.js apps and email on Windows Server 2022/2025, without IIS. Download · Ask on Discord
Home · Repository · Download · Discord
Start here
How to
- Node app as a Windows Service
- SSL without IIS
- Deploy from GitHub
- WordPress on Windows
- Host your own email
- Host from a home PC
Choosing
Problems