Email Migration

Migrate hMailServer to Office 365 over IMAP or from a copy of your Data folder

Leena Taylor Paul By Updated November 14, 2026 7 min read

Quick Answer

hMailServer offers no export to Office 365. Two other ways reach your new mailboxes. Microsoft can read your live server over IMAP and copy its mail, but only after an admin adds the secure ports and only for mail. You can also copy your Data folder and turn its .eml files into PST files. The IMAP method needs the server online and a password for every account, whereas a copy works with the server off.

Microsoft sets a ceiling of 500,000 items per mailbox and a 35 MB message size for IMAP migration.

Microsoft 365 is your company's next mail platform and your hMailServer machine is the last old Windows server in the office, so you may expect an export to Office 365. hMailServer has none. Our hMailServer email settings page notes that development is paused at version 5.6.8, so a move is often overdue. Microsoft 365 can fetch mail from your live server over IMAP. You can also build files from a copy of your Data folder and import them.

The method depends on two facts about your server. If it still starts and you can set a password for every account, Microsoft's own IMAP migration needs no extra software, so a small domain can start there. If the server is gone or you want files, work from a Data folder copy. A program opens the copy and your old machine can stay off.

Start with the method that matches your server
  • If your server is online and you can reach every account, use Microsoft's IMAP copy after you add the secure ports.
  • If your server is off or its disk is the only thing left, copy your Data folder and build PST files from the copy.
  • If a company has two domains, put every address into one list, because both methods work from a list of accounts.

Why Can't Microsoft 365 Read Your hMailServer Mail Directly?

Each hMailServer message becomes one .eml file, placed in a folder named for its domain and account. The account and folder names stay in its database. That database can be MySQL, MS SQL or PostgreSQL. Microsoft 365 has no connector for that layout, so your mail has to arrive over IMAP or as PST files, which Outlook and Exchange Online both accept.

Before you choose IMAP, check your ports. A new hMailServer listens only on ports 25, 110 and 143. The secure ports 993, 995 and 465 start working once an admin adds a certificate for them. Also, hMailServer has no app passwords and no two-factor sign-in, so every account uses the password that an admin set, which means you need that password for a Microsoft 365 batch.

Microsoft sets limits on the IMAP door, so check them against your own mailboxes (a quick check in Outlook). Microsoft's IMAP migration page says the migration moves mail only. Its ceiling is 500,000 items per mailbox and a 35 MB message size. Newest mail goes first, so the oldest mail may stay behind in a large mailbox.

Who Moves hMailServer Mail to Microsoft 365?

Which of these sounds like your server?
  • An ageing Windows server Your hMailServer 5.6.8 machine works but the company wants Outlook with Microsoft 365 for every person.
  • A small business with one domain You look after ten to forty accounts and the owner wants the move finished in a weekend.
  • A machine that no longer starts You have a copy of the Data folder from a backup and no working hMailServer.
  • A leaving employee One mailbox has to reach Outlook before the account is deleted.

Which Method Fits Your hMailServer to Office 365 Migration?

You have two methods to choose from. Compare their requirements in the table below.

MethodSteps involvedRequirements and limits
IMAP migration by Microsoft You add your hMailServer host as the source. Microsoft 365 then reads each mailbox and copies its folders in turn Needs a live server with secure ports, a password for every account and existing Microsoft 365 mailboxes
Files from a Data folder copy A Windows tool reads the .eml files of your copy and outputs PST, EML or MBOX files or sends them to an IMAP host Needs a Windows computer and a paid licence for the full export. A PST needs a separate import step

I'd choose IMAP when your server is healthy and you have fewer than a few dozen accounts, since Microsoft does the copying and you only watch the batch in the Exchange admin center. However, when the server is down or mail passwords are lost, I'd rather start from the copy, because the copy needs no login at all.

Move hMailServer Accounts Over IMAP Into Microsoft 365 in Five Steps

For the batch screens, read our migrate IMAP to Office 365 guide. The steps below stay on hMailServer itself.

  1. Add the secure ports. Ask your admin to add port 993 with a certificate, because a new hMailServer listens on port 143 only. The values are listed on the email settings page.
  2. Prepare Microsoft 365. Create every person as a user and assign a licence. If you move a domain, verify that you own it with your registrar first.
  3. Set the passwords. Put each address and its password into a CSV file. If you don't know a password, set a new one in hMailServer first.
  4. Start the batch. In the Exchange admin center, add your hMailServer host as the migration source and start a batch from your CSV file. Turn off MRM and archive policies first, as Microsoft advises.
  5. Compare and switch. Compare a few mailboxes with hMailServer. Then change your MX record and delete the batch once new mail reaches Microsoft 365.

If Microsoft can't connect, the cause is often the port. Open the hMailServer settings and check that port 993 exists and that its certificate is valid.

Build Files From Your hMailServer Data Folder Copy

Univik hMailServer Migrator reads the .eml files of your copied Data folder. When you also copy the database, it uses the database to name each account and folder. It then uploads the mail to an IMAP host or saves PST, EML or MBOX files. Because it reads your copies, you don't need hMailServer on the PC.

The migrator reads two copies on a Windows PC and never contacts your live server.
  1. Copy the Data folder. Stop the hMailServer service first, so no file changes while you copy. Then bring the complete Data folder over to a Windows PC.
  2. Copy the database. Copy the database as well, since it records which account and folder each message came from. A copy without it still moves the files, but the names may be missing. Outlook then shows a flat list of folders.
  3. Add both copies. Start the migrator and select your Data folder copy, then the database copy. Add the list of accounts you want to move.
  4. Choose PST. Select PST and start the batch. If a damaged .eml file appears (an easy problem to spot), the batch leaves it out and names it in the log.
  5. Check the result. Open three PST files in Outlook and check their folders against your hMailServer accounts before you import them.

Limitations: the free trial moves 25 messages in each folder, so one account is enough for a test. The migrator needs Windows 11 or Windows 10 with .NET Framework 4.8. My testing never covered the migrator sending mail straight into Microsoft 365, which is why the Microsoft side of this guide uses PST files. I haven't timed a large batch either, so test one account for its speed.

Turn your hMailServer copy into PST files

On Windows, your Data folder copy turns into a separate PST file for every account on your list.

Download Free Trial Select a Licence - From $999

Test one account with the trial first. Open its PST in Outlook before you buy.

Copy the Data folder and the database together before you change anything on the server again. Two copies tell you which account and folder each message came from. Your first test mailbox will show that within minutes.

Nick Rogers, Founder of Univik
Nick Rogers
Founder, Univik
Making Windows software since 2013

Import the PST Files Into Microsoft 365

For one person, classic Outlook can import a PST file through File, then Open & Export and Import/Export. A domain with many accounts is better served by the Microsoft Purview Import service, which offers a free network upload. Microsoft's PST import overview limits each PST to 20 GB and skips items over 150 MB. The mapping file is covered in our import PST to Office 365 guide.

What If Names, Folders or Mail Are Missing?

1. Microsoft cannot reach your server

Do this: A fresh hMailServer listens on port 143 only, so secure connections fail until an admin adds port 993 and a certificate. Check the port before you blame the password.

2. Account or folder names look flat

Do this: The database contains the names, so a Data folder copy without it often gives you messages without folders. Add the database copy beside your Data folder and start the batch again.

3. Early mail never reached Microsoft 365

Do this: IMAP migration has a ceiling of 500,000 items per mailbox and a 35 MB message size. Check the mailbox against your Data folder copy, because newer mail on the live server is missing from the copy.

If one mailbox still seems wrong, contact Univik and send your hMailServer version with the account involved.

Where Do the hMailServer Facts in This Guide Come From?

On 14 November 2026 I went through Microsoft's IMAP migration page and the Purview PST import overview. The hMailServer documentation was not open to my reader that day, so the port and password facts come from our own email settings page, which was tested with live connections. Univik's migration page was my third source. Forum posts stayed out of this guide, since each number needs a documented source.

Key Takeaways
  • hMailServer has no export to Office 365. Your mail arrives through IMAP or in PST files built from a copy of your Data folder.
  • A new hMailServer listens on port 143 only, so add port 993 with a certificate before Microsoft connects over a secure port.
  • Microsoft's IMAP migration moves mail only and has a ceiling of 500,000 items per mailbox. It needs a password for each account.
  • A migrator reads the .eml files of your Data folder copy and uses the database copy for account and folder names.
  • Before you change the MX record, check one account against your copy.

FAQ: Migrate hMailServer to Office 365

How do I migrate hMailServer to Office 365?

Use Microsoft's IMAP migration while hMailServer is online. A second option is to turn a copy of your Data folder into PST files and import those. IMAP copies mail only and requires a password for every account.

Can Microsoft 365 connect to hMailServer over IMAP?

Yes, once your server accepts IMAP. A new hMailServer listens on port 143 only, so an admin has to add port 993 with a certificate for a secure connection.

Where does hMailServer keep the mail I need to copy?

hMailServer keeps every message as an .eml file in the Data folder, under a folder for its domain and account. The database keeps the account and folder names, so copy both.

Do I need the password of every hMailServer account?

For Microsoft's IMAP migration, yes. hMailServer has no app passwords, so every account uses the password an admin set. A copy of your Data folder needs no passwords at all.

What limits does Microsoft's IMAP migration have?

Microsoft's page sets a ceiling of 500,000 items per mailbox and a 35 MB message size. It moves mail only. Contacts, calendar items and tasks stay behind.

Can hMailServer mail move after the machine is switched off?

Yes. Copying the Data folder with its database is enough. A migrator reads the .eml files of your Data folder copy on a Windows PC and creates PST, EML or MBOX files without contacting the old server.

Can I test the hMailServer migrator for free?

Yes. The trial of Univik hMailServer Migrator moves 25 messages in each folder. One account is enough to test before you buy a licence.

Is hMailServer still updated?

Our email settings page notes that development is paused at version 5.6.8, a build from 2021 with only critical fixes since. Many admins treat that as a reason to move.

Leena Taylor Paul

Microsoft figures for IMAP and PST come from two Microsoft Learn pages read on November 14, 2026. The port facts follow the Univik email settings page.

More Guides for hMailServer and Microsoft 365

Choose the guide that matches your hMailServer machine or the next step on the Microsoft side.