tool to migrate from Imail 8 to hmailserver 5

This section contains scripts that hMailServer has contributed with. hMailServer 5 is needed to use these.
Post Reply
New user
New user
Posts: 3
Joined: 2013-05-16 20:53

tool to migrate from Imail 8 to hmailserver 5

Post by damititi » 2013-05-16 20:57

I saw that there are some tools to migrate to hmailserver 4.
is there something around there for version 5?



User avatar
Posts: 21038
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: tool to migrate from Imail 8 to hmailserver 5

Post by mattg » 2013-05-17 00:58

Easiest way to migrate a few accounts is to connect to both servers with an IMAP client and simply drag the mail/folders from one server to the other

If you have lots of accounts you can do something similar with tools like IMAPcopy (if you know all user's passwords)

If not using IMAP, then accounts and domains can be created from a script and dumped text file.

How many accounts?
How Many domains?
How much mail?
Do you use IMAP?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.

User avatar
Senior user
Senior user
Posts: 1105
Joined: 2008-06-27 14:42
Location: Netherlands

Re: tool to migrate from Imail 8 to hmailserver 5

Post by RvdH » 2013-06-14 12:41

IMail 2 HMail v0.88 Beta
The IMAP mailbox heirarchy didn't copy correctly, and every mailbox
ended up as a child of INBOX. This has been corrected, and I've added some
additional error messages in case of failure.

IMail 2 HMail v0.87 Beta
It was brought to my attention that this program only copies the INBOX
messages for each user from IMail to HMail. This was an oversight, in that we
were not using the IMAP functionality in IMail, and so our server had only the
INBOX folder on the server. This has been corrected, and it now reads every
mailbox, attempts to select and/or create the same mailbox on the HMail
server, and copy the messages over. There is also a separate help document
now that explains how to run IMail to HMail.

IMail 2 HMail v0.86 Beta
Fixed a crash bug with empty source/destination ports, and accounts
now copy their active/enabled status from HMail correctly.

IMail 2 HMail v0.85 Beta
Fixed a crash bug with invalid values in the progress bar in certain

IMail 2 HMail v0.84 Beta
An issue where if you registry was on a 64 bit machine, it would not
read correctly.

IMail 2 HMail v0.82 Beta
A minor fix to the setup page, and an update of all the version number

IMail 2 HMail v0.8 Beta

This is the first version of the IMail 2 HMail converter. This
utility can convert all your IMail accounts and aliases to HMail accounts,
aliases, and distribution lists. It also has the ability to use IMAP to copy
all your mail from an IMail server to an HMail server using the account
information it had from the migration. It hasn't been tested with different
IMAP servers other than IMail and HMail, but in theory, it should work on
those as well. We used this tool to move our email server over from IMail to
HMail, so it has been used in production, but it hasn't been extensively
tested beyond that.

IMail 2 HMail is a program that, when run on the same machine as your
IMail server, will be able to copy all users, aliases, mailboxes, and mail
messages using the IMAP protocol from the IMail machine to an HMail machine.
This program was written to move mail to HMail, but likely works on any mail
server that supports IMAP. For this program to work, both the IMail server and
your HMail server need to have IMAP enabled.

The program itself is split up into 2 sections. The first section
copies all your accounts and aliases from IMail to HMail, and the second part
of the program copies all your mailboxes and messages from IMail to your HMail
server. The program is split up visually along these lines, with the top right
settings specifying an account on your HMail server with admin privileges.
This account will be used to login to your HMail server and create all the
users. The second section of the program is the bottom, and it is the section
that will use IMAP to copy from the source server to the destination
server (IMail to HMail).

The program MUST be run on the same machine that IMail is installed on.
If you cannot install or run this program from the same machine, please consult
the notes below for a workaround. When the program is executed, if it has read
all the IMail information correctly, you should see a list of mail domains in
the box on the top left. If you do not see a list of mail domains (there
should be at least one), then something has gone wrong. The checkboxes by
each domain let you select/deselect the domains you want to process.
Unprocessed domains will not have their mail copied.
If you see a list of domains, select the domains you want to transfer.
Then you should put in a username and password with admin privileges on your
HMail machine. This will generally be the administrator account. Make sure
you check the "Copy Accounts to HMail" button if you want to copy all the users
and aliases.
The final section is the mail section. This section is where you
specify the source (your IMail server) IP/domain name and port number as well
as your destination (your HMail) IP/domain and port number. The standard IMAP
port is 143, but this may be different on your server.
Once you have entered all the settings in, you should be able to hit
the convert button and the program will start executing. It will explain what
it is doing in the box on the bottom.

How it works -
It is not difficult to use IMAP to copy mail messages and mailboxes
from one machine to another, but you would need the username and password for
every user entered in a list to be able to do this. Most server software
stores user passwords in a one-way hash. IMail does not, it stores encrypted
passwords that are NOT hashed in the registr. If you know how it encrypts
the passwords, you can read the username and password for every mail user on
your IMail server. This is a huge security hole, but is convenient for moving
to a different server. This program reads that registry information, and then
uses IMAP and the account information it read to copy all the usernames,
passwords, mailboxes, and mail messages over to a different mail server.
Since HMail doesn't suffer from the same limitation (to our knowledge), you do
need to specify an account with administrative privileges on your HMail server
to make it work.

Aliases -
A couple small pieces of information that may be important. If you
forwards setup to multiple email addresses on IMail, this isn't supported in
the same way on HMail. HMail only allows you to forward to a single email
address. If you have such accounts, this tool will create a new distribution
list with the same name as your email address, followed by _distribution.
This distribution list will be populated with all the addresses to forward to,
and the original email address will be set to forward to the distribution
list. Functionally, it should be transparent to your users, but that is why
multiple distribution lists may be created.

Running from a different machine -
Sometimes it may be inconvenient to have IMail and HMail both
installed on the same machine. If you want to test this on a machine that is
not your live server, the tool gets the IMail account information from the
registry, in the key \\HKEY_LOCAL_MACHINE\Software\Ipswitch\IMail. If you
export all the keys into a .reg file, you can then double click on it to
re-import the account information to the machine where you want to run the
software. If you want to copy all the forwards as well, you will also have to
copy the mail data directory over. This is located in the directory specified
by the TopDir key in
\\HKEY_LOCAL_MACHINE\SOFTWARE\Ipswitch\IMail\Domains\<Your domain>\Users. You
just need to copy this folder over to your new machine, and we'll be able to
get at all the forwarding information.

For actual mail data to be copied, you have to IMAP enabled and
available on both IMail and HMail. This server information needs to be
specified in the fields at the bottom of the dialog.

Running multiple times -
Account information can be migrated multiple times, and our utility
will not create duplicate accounts. When you are migrating mail data, we
aren't able to easily detect whether mail messages already exist on your
target server, so running the tool multiple times may result in duplicate
CIDR to RegEx:
DNS Lookup:
DNSBL Lookup:
GEOIP Lookup:

New user
New user
Posts: 3
Joined: 2013-05-16 20:53

Re: tool to migrate from Imail 8 to hmailserver 5

Post by damititi » 2013-06-25 21:19

Thanks both for replying.

here are the answers and my actual problem:

How many accounts?

How Many domains?

How much mail?
about 4gigas

Do you use IMAP?
I used "IMail 2 HMail" tool and I was able to recreate all the accounts and their passwords.
The new server (hmail) has all the accounts, but when I tried to copy all the messages using Imail2Hmail, the program hungs and exit with an error. It is always at a different point, after several hours of running.
It process about 2 gigas of the 4 gigas.

the process of moving emails tooks more than 1 day (the servers are in different countries!) and it makes me difficult to test, but I will try using imapcopy to move the mails.



Post Reply