Articles
Setting up your own email server with hMailServer
Configuring your DNS records
Before we install your mail server it is a good idea to ensure you DNS records are correctly setup for email. DNS is vital to the operation of the Internet, and in a nutshell what it does is create a link between a human friendly domain name (e.g. example.com) and an IP addresses. When a user enters a web address into their browser, that domain is then resolved to an IP address which is then used to communicate. When hosting your own email server there are three very important types of DNS records to consider, and these are A, PTR and MX records.
An A record, or Address record is one of the most common types of DNS records you'll come across. Its purpose is to simply create a link between an IP address and a domain name. For example for the domain name of example.com you would have an A record that contained the IP address of the server that was hosting example.com. With A records the domain must be unique, but the IP address does not. This means you can have as many domain names pointing to the same IP address as you want, and is used extensively these days for both Email and Web hosting. In regards to your Email environment, it is best to create a separate A record that identifies your email server. This can be something like mail.example.com or similar. You'll need to create an A record for each server you plan on using as a mail server.
A PTR, or Pointer Record is unique in DNS in that you can only have one PTR address per IP address. This is because the function of a PTR record is to resolve a human friendly name from an IP address, instead of the other way around. Because you are resolving a domain name from an IP address, there can only be one authoritative record. If possible it is best to set your PTR record of the IP your email will be hosted from to be the same as your A record (e.g. mail.example.com), and you may need to contact your hosting company to do this for you.
Finally we have the MX, or Mail eXchange record which is used by other mail servers to direct email to the right place. Unlike an A or PTR record an MX record is not associated with an IP address in anyway, but instead contains the human friendly name of the A record you wish to use for your mail server. This might sound a little redundant as all it is doing is pointing from one record to another, but MX records also have one other important function. This is to establish the pecking order of your email servers by using a preference field in which you can enter a numerical value (the lower the number, the more important that server is) to define in what order other email servers should contact your email servers. If the email server with the highest preference (lowest number in preference field) is not contactable, then incoming email servers will simply use the server identified by the MX record with the next highest preference.
- Add new comment
- 574528 reads

Comments
All in the guide
Had a quick look at your DNS records for the co.cc domain and think you may need to look at that. For a start you have a hotmail server set as your MX record where it should be ponting to your own email server (have a look at page 2 of the guide regarding DNS record requirements).
I also did a service scan of the IP address associated with www.co.cc and unless this is IP is using NAT, then this is not even a Windows server and ports 25, 110 and 143 are not open.
----------------
Dominic Ryan
5 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster
Unable to send email
Thanks for your response, I have checked my Hmailserver again and I got following results.
I. Checked using Diagnostics of HmailServer and it's passed.
Then .....
II. Telnet from a workstation in LAN of my office:
-------------------------------------------------
1. Checking Port 25 (SMTP):
220 Welcome to SMTP Server of PT. Universal Intersystem Perkasa
help
211 DATA HELO EHLO MAIL NOOP QUIT RCPT RSET SAML TURN VRFY
2. Checking port 110 (POP3):
+OK Welcome to POP Server of PT. Universal Intersystem Perkasa
help
+OK Normal POP3 commands allowed
quit
+OK POP3 server saying goodbye...
3. Checking port 143 (IMAP):
* OK Welcome to IMAP Server of PT. Universal Intersystem Perkasa
III. Then I tried nslookup to my MX record from my email server and i have following results:
--------------------------------------------------------------------------------------------
> set type=MX
> support.ptuip-mail.co.cc
Server: UnKnown
Address: 192.168.2.1
Non-authoritative answer:
support.ptuip-mail.co.cc MX preference = 0, mail exchanger = ptuip-mail.co.cc
co.cc nameserver = ns2.co.cc
co.cc nameserver = ns1.co.cc
co.cc nameserver = ns.co.cc
co.cc nameserver = ns3.co.cc
ptuip-mail.co.cc internet address = 124.153.15.29
ns.co.cc internet address = 114.207.246.170
ns1.co.cc internet address = 222.122.6.20
ns2.co.cc internet address = 222.122.6.21
ns3.co.cc internet address = 118.219.232.169
>
IV. Checking my MX record from internet
-----------------------------------------
1.MX Query from result from http://webtools.live2support.com/nt_mxrecords.php:
MX records for support.ptuip-mail.co.cc found.
Host Valid for this(ari@support.ptuip-mail.co.cc) Email Address..
Host Name Host IP Address
ptuip-mail.co.cc 124.153.15.29
2. Another MX Query from http://www.webmaster-toolkit.com/mx-record-lookup.shtml?email=root@support.ptuip-mail.co.cc
Found these mail servers for
0 ptuip-mail.co.cc
V. Trying to check port 25,110 and 143 from outside world (internet) using Telnet
-------------------------------------------------------
Welcome to Microsoft Telnet Client
Escape Character is 'CTRL+]'
Microsoft Telnet> open ptuip-mail.co.cc 25
Connecting To ptuip-mail.co.cc...Could not open connection to the host, on port
25: Connect failed
Microsoft Telnet> open ptuip-mail.co.cc 143
Connecting To ptuip-mail.co.cc...Could not open connection to the host, on port
143: Connect failed
Microsoft Telnet> open ptuip-mail.co.cc 110
Connecting To ptuip-mail.co.cc...
+OK Welcome to POP Server of PT. Universal Intersystem Perkasa
help
+OK Normal POP3 commands allowed
-ERR Invalid command in current state.
quit
+OK POP3 server saying goodbye...
Connection to host lost.
Press any key to continue...
I would like to ask :
1. From step V Is that correct that my ISP provider is blocked port 25 and 143??
2. Is it possible I use freware smtp relayer such as 1st SMTP Server 5.6 to overcome the problems of closed port 25 and 143 ??
Thanks for your time.
Ports being blocked
I tried to telnet to port 25, and was not able to make a connection. Unless your firewall hasn't been configured to allow requests through, then I'd say the next most likely thing is that your ISP has blocked your ports. If this is the case, then you'll need to contact them or just use their SMTP server as a smarthost.
----------------
Dominic Ryan
5 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster
I am not able to download mail from an external POP3 account
Greetings
I run a PostFix Mail server on a CentOS server. I host a number of different mail domains for different customers.
One of my customers needs access to an IMAP Mail server. While my server does this wonderfully, my client abuses it (they never delete ANY mail, not even spam... so my mail server's HD starts getting really full with all their mail).
So I want to give them their own IMAP mail server at their premises, which they can abuse to their heart's content. I have download hMailServer and I am busy running some tests.
So far, I am able to create their domain, create a user on the domain, connect Thunderbird (Outlook 2003 is a terrible IMAP client) to the hMailServer account via IMAP, send mail from the account and download mail from a gmail account (the hMailServer is able to log into gmail, download mail, delete it off the gmail servers and deliver it to the hMailServer Account).
But right now, it does not download mail from *MY* PostFix Mail server.
In the log file, I see these lines when I "force" it to download from the external POP3 account:
"DEBUG" 3732 "2009-10-12 16:15:21.748" "Creating session 148"
"TCPIP" 3732 "2009-10-12 16:15:21.748" "Connecting to mail.clan.co.za..."
"POP3D" 3016 148 "2009-10-12 16:15:21.764" "196.36.155.3" "RECEIVED: 220 cerberus.xperts.co.za ESMTP Postfix"
"POP3D" 3016 148 "2009-10-12 16:15:21.764" "196.36.155.3" "SENT: QUIT"
"POP3D" 3016 148 "2009-10-12 16:15:21.795" "196.36.155.3" "RECEIVED: 221 2.0.0 Bye"
"DEBUG" 3732 "2009-10-12 16:15:21.795" "ExternalFetch::~Start"
"DEBUG" 3160 "2009-10-12 16:15:21.811" "Ending session 148"
It does not even look like it is trying to authenticate.
What could the problem be?
I am not able to download mail from an external POP3 account
Greetings
Man, do I feel like an idiot. I do not know how many times I went over all the setting to make sure everything was right. Eventually noticed I had port 25 in my POP3 port instead of 110. D'Oh!
It works now.
Mail sorting / account setup
Hi
I have just started to use hMailServer and I'm able send and receive email. So this means something i working, but sometimes an Email turnes up where I'm not expecting it.
So I have a master mail account like . So I have made an account for this. Lets say I have 3 mailboxes under this domain. (User1), (User2) and (User3). Now I would like all the mails send to to be "delivered" to either one of my mailboxes for each users.
How do I do it? Do I make 3 accounts , and ? Do I need to make some setup, in order to have the mail sorted in the right mailboxes?
Alias or a rule
If you want all email sent to to also be sent to other email addresses, then you'll need to configure those accounts with an alias of . You could also do this using a rule to forward email to the recipients you need.
----------------
Dominic Ryan
5 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster
All configs OK but no received mail
Went through all posts submitted here. Configured hMail, firewall opened ports, conneceted to outlook....
When testing from hMail or outlook or via DNStool all settings are correct. Ports are open and cen send via my SMTP (internet provider).
It all worked 'till today.
None of mails, even test ones can't be received. Any suggestions??
Check your MX record
If your ports are definitely open, check your MX record is correct. If the MX record is correct, ensure the A record (e.g mail.mydomain.com) is pointing to the correct IP address.
----------------
Dominic Ryan
5 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster
Still no working.
Ports 25 and 110 are open (don't use IMAP). All are pointed to server psychop.dyndns.org. this is from one test:
Mail server psychop.dyndns.org[93.103.181.72] answers on port 25
and second test:
Success: I can see your service on 93.103.181.72 on port (110), Your ISP is not blocking port 110