Setting up your own email server with hMailServer

There are a many email servers for Windows out there that range in price depending on functionality and the software vendor. However, it is not often you find an email server for Windows that is open source (free to use and modify via the GPL license), feature rich, stable and very well supported. There are some notable free offerings such as MailEnable Standard and Windows 2003 Server even comes with a basic POP3 email server, but it seems that they are always just crippled enough to make you want something a bit more. This is where hMailServer comes in as it offers just about everything you could want in an email server. SMTP with advanced routing abilities, POP3, IMAP4, distribution lists, powerful anti-spam tools, real time anti virus protection, PHP/COM based web administration, log file analysis, configurable server messages and rules, advanced performance options. The list goes on, and all this in a RFC compliant package with an easy to use GUI interface.

In this guide we'll cover the basics of what you need to do to configure your email environment properly using hMailServer 4.3.1 as your email server. This includes;

  • Configuring you DNS records
    • A (Address) record
    • PTR (Pointer Record) record
    • MX (Mail eXchange) record
    • Considerations for hosting from home
  • Installing hMailServer
    • Select installation path
    • Select installation type
    • Select built-in or external database
    • Select program group for start menu access
  • Configure hMailServer
    • Create domain
    • Create postmaster account
    • Create abuse alias for postmaster account
    • Set SMTP host name
    • Configure RFC compliance
    • Configure SMTP relay options to prevent open relay
  • Test your email environment
    • Test against dnsreport
    • Test for open relay
Average rating
(6 votes)
|
Submitted by Dominic Ryan on Wed, 2007-04-11 15:55.
Anonymous | Mon, 2007-05-07 12:24
Anonymous's picture

cannot setup client to send or recieve mail from hmail server.
when setup client on the same computer, it works fine.but to access mail from a workgroup pc, comes up with errors

Brashquido | Tue, 2007-05-08 19:16
Brashquido's picture

What errors? If you are running a software firewall, then you will need to open the ports in use by hMailServer. Namely TCP ports 25, 110 and 143.

Anonymous | Wed, 2007-12-26 14:24
Anonymous's picture

hy. i cant send mails with hmail server when i`m trying to send an email it gaves me an eror "smtp requires auth" what can i do?

Brashquido | Wed, 2008-01-02 15:46
Brashquido's picture

This will be a settings issue. By default hmail requires authentication to send email to domains it does not host. All you need to do is ensure that you enter a username and password in the SMTP setttings in your email client. Only realy thing to note here is that hmail only accepts usernames in the form of .Let me know how you get on.
----------------
Dominic Ryan
3 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous | Wed, 2008-02-13 11:17
Anonymous's picture

hy, I can send mail with hmail but i don't receive any mail. If i change in my client POP3 server to mail.domain.es, i can receive all mails, but i change to nameserver, ican't receive any mail.

Thanks, and sorry for my english.

Brashquido | Sun, 2008-02-17 18:52
Brashquido's picture

You'll need to set your POP3 server to the name or IP address which your server is connected to the Internet with.
----------------
Dominic Ryan
3 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous | Thu, 2008-02-21 18:25
Anonymous's picture

Hello,

I can't receive email with hmailserver. My web host told me it is something to do with pop3. How an i configure it? I went under protocols and I cannot configure it.

Brashquido | Thu, 2008-02-21 23:27
Brashquido's picture

SMTP is responsible and sending and receiving messages, POP3 (or IMAP4) handles your message storage. What do your Hmail SMTP say?
----------------
Dominic Ryan
3 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous | Fri, 2008-03-14 06:24
Anonymous's picture

Hey I m not able to send or receive messages with use of hmailserver, What can i do? Please help me.

Brashquido | Fri, 2008-03-14 09:56
Brashquido's picture

That could be caused be any number of things. Are you running your mail server over a residential Internet connection? Have you followed the SMTP configuration instructions on page 5?
----------------
Dominic Ryan
4 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous | Thu, 2008-04-03 14:33
Anonymous's picture

I'm running hmailserver on an internal LAN used for training. There is no connection to the outside world. I have an internal domain name (using Win 2003 svr) but i'm running hmailserver on an XP box. My problem is when I try to connect my email clients to hmailserver using either outlook or outlook-express, they report back that the connection was rejected because either the username or password is wrong.
I've verified the password and username format (username@domain.xxx) and still unable to resolve.
Can you offer any help?

Anonymous | Fri, 2008-04-04 18:10
Anonymous's picture

Yesterday I asked for help in resolving an issue with rejecting username or password. Today I'm reporting that the mystery is solved. I unchecked the box that allows connection to an Active Directory account and the problem went away. Guess there is something with the connector that is stopping it from working properly. For the moment we just have to remember to change passwords in two places.

Brashquido | Sun, 2008-04-06 18:18
Brashquido's picture

Hmm, that is a bit unfortunate to have this double up. Do you know how far into the authentication process hmail was getting? For example, is there anything in your hmail logs or the security logs in the event view of the domain controller you are authenticating against?
----------------
Dominic Ryan
4 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous | Wed, 2008-04-16 03:34
Anonymous's picture

Hi, I have done all the steps completely, and my server is running well, but i dont know how to configure my mail client (Outlook express) to use the mail i've made (with my own domain); i'm not sure about the POP3, SMTP server address part in outlook. Does anybody know what will be SMTP and POP3 address of the mail? btw, i'm running it on localhost.

Thanks

Brashquido | Wed, 2008-04-16 19:50
Brashquido's picture

You can use DNS, or simply IP for the SMTP/POP3 address. The only other thing to remember with hmailserver is that you must include the domain when specifying the username, e.g;

user@domain.com
----------------
Dominic Ryan
4 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous | Sat, 2008-04-19 17:58
Anonymous's picture

using netserver on win xp
web server working (mydomain.com)
hmailer configured as pop3.mydomain.com, smtp.mydomain.com
can receive mail but cannot send mail to "internet" or external mail
outlook express thinks all ok on sending. no message of bad delivery.
but if smtp.mydomain.com is changed to smtp.myisp.com then all ok
Can received and send as normal. Please comment.

Brashquido | Sun, 2008-04-20 21:42
Brashquido's picture

Few things too look at;

1) Is your domain space resolvable via the Internet?

2) Does your ISP block port 25?

3) Have you opened port 25 on your router?
----------------
Dominic Ryan
4 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous | Mon, 2008-04-21 04:24
Anonymous's picture

Thanks for your comments.
I have got it working. Forgot to fill in smtp relayer.
Setting it to smtp.myisp.com resolved all the problems.
Thanks

Anonymous | Tue, 2008-04-29 12:20
Anonymous's picture

can i use hmailer to forward emails composed within phpbb3 which is hosted on my own webserver (apache on a sever 2003box) and use the hmailer smtp to push the mail out over the internet via smtp on my isp provider ? I'm not interested in receiving mail, just sending to a small user community.

If so is there anything inparticulaer i should look at ?

Brashquido | Tue, 2008-04-29 15:49
Brashquido's picture

Yes, you could do this. But if you plan to relay off your ISP SMTP anyway, could you not use the PHP mailer to mail directly to your ISP SMTP?
----------------
Dominic Ryan
4 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous | Wed, 2008-06-04 19:14
Anonymous's picture

I've used your tutorials to install PhP5 and MySQL5 and they were the tutorials on the net that actually worked for me! Thanks!

This maybe one of the stupidest questions you'll get but I am new running the server myself.

I am working on the website http://www.motorcyclemonster.com and we are trying to get it to where we have both a place to forward an e-mail newsletter through and also to have e-mail address such as . We run the site out our own server with Windows 2003 Server, IIS 6.0, PhP5 and MySQL5 installed.

In the tutorial to get HMailServer installed it says to make the name mail.domainname.com (in this case mail.motorcyclemonster.com). Now, how do I get the mail. subdomain to our server? and how does HMailServer pick it up. Do I have my Domain Managing company create and forward mail.motorcyclemonster.com to our server (because they don't allow me to do that through a panel) or what exactly?

Brashquido | Thu, 2008-06-05 09:22
Brashquido's picture

Not a stupid question at all :) ! When talking about your DNS records for your email environment, there are three different records which you need;

1. Your A record will simply resolve mail.motorcyclemonster.com to the IP address your mail server is connected through. If your DNS hoster doesn't provide an interface to create A records for yourself, you will need them to do it.

2. Your PTR record is the opposite of your A record in that it will resolve from your IP address back to your A record. There can only be one PTR record per IP address, and you'll actually have to contact your Web hoster rather than your DNS host as they will be the only ones with control over your PTR. Some web hosts may not be prepared to change this for you, but if your have a dedicated or virtual server then I'd say they would.

3. You MX record is vital as this instructs other email servers where email destined for your domain should be sent. All the MX record does is contain the name of the A record you created for your domain, i.e mail.motorcyclemonster.com along with a number indicating the preference for this server. In the even you have multiple email servers you would have multiple A, PTR and MX records, and the MX record with the highest preference (lowest number) would be used first.

After you have set up these DNS records, you'll also need to ensure you configure the host name setting for the SMTP service.
----------------
Dominic Ryan
4 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous | Sat, 2008-06-14 07:28
Anonymous's picture

Dear All

Please help

I have configuar hamil it is working fine. but when i recived mail frim hmail user we get wrong time show i have checked my date time seting it is ok,

Anonymous | Sat, 2008-06-14 07:59
Anonymous's picture

Hi, first of all I'd just like to say thanks for the gr8 tutorial here. My installation and setup went quite smooth but I'm still having an issue, which seems rather bizarre. If I try to send from a remote email address to my hmail address using a separate ISP email service, nothing is received at my hmail email address. Although, it *does* send from my local hmail and email client but only to myself, almost as if hmail seems to be acting strictly like a LAN email server. So I guess my question would be why am I not receiving messages at remote locations and only local? I have double checked all my settings to be the same as everything shown in your tutorial, so at this point I'm guessing this probably has something to do with the "SMTP Relayer" section but not sure. I've tried using both Mozilla Thunderbird and Outlook Express to send/receive, which again both work fine when test sending to *myself* but nothing is received in my hmail inbox after sending from a remote address to hmail and hmail emails don't arrive at the remote address either.

Brashquido | Mon, 2008-06-16 15:41
Brashquido's picture

From memory Hmail uses your system time settings for time/date stamps. Check your SMTP logs and check that the correct time is being logged there. Is the time/date set correctly on the client PC?

For the send recieve issue, over what sort of connection are you hosting your Hmail install? If you are using a home broadband internet connection then there is a fair posibility that your ISP is blocking the SMTP port into your server. Also check that you have allowed SMTP in your local firewall policies.
----------------
Dominic Ryan
4 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Post new comment

  • Use <!--pagebreak--> to create page breaks.
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use BBCode tags in the text, URLs will automatically be converted to links.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Copy the characters (respecting upper/lower case) from the image.