hMailServer is an extremely easy to configure mail server for Windows, and also extremely lightweight. Despite being free it has a lot of features, SSL, IMAP, user authentication with Active Directory, etc. Its only flaw, unfortunately, is that it is in a state of partial abandonment. Every few months the developer releases an updated version where only the OpenSSL library is updated, but the “heart” isn’t touched since a few years (decades?) ago. So, despite being an excellent product, it is not really recommended to install it on modern computers, because:
- It’s a program that is exposed to the internet on ports that are very targeted by bots, there is a bit of a security risk.
- It assumes that you are using outdated technologies.
However, it’s perfect for using it on your local network for “fun”.
To set it up with MySQL (or MariaDB) you need to consider three tricks:
- Fifteen years ago the app was freemium and not open source, the MySQL license did not allow DLLs to be included. Nowadays for some reason, even though the app is GPL and could include them, it doesn’t. So you need to go get libmysql.dll from the portable 32-bit version of HeidiSQL. (Or from the monstrous setup of MySQL for Windows, but I don’t recommend it).
- MySQL 8.0, for new users, sets an authentication system which is not recognized by hMailServer. You need to change it by executing this query:
ALTER USER 'youruser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youapassword';
. I limited the user to localhost, but otherwise it should be set as it is on your server, for example`youruser'@'%'
. - Both MySQL 8.0 and MariaDB 10 report database versions that are not supported because they were up to 5.6 at the time. So you have to manually create the database by using the script located in
C:\Program Files (x86)\hMailServer\DBScripts\CreateTablesMYSQL.sql
.
After this the program works great!
Otherwise, you can use the internal Microsoft SQL Compact-based database, but I personally don’t like it.