Setting Up a Windows Mail Server

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-21 12:49

Hi all,

I've had a quick look through the forums, but can't find anything that seems to specifically answer my queries, so I'm hoping you can help.


The Current Situation

Ok, I act as network manager for a small UK business. All my expertise lies in internal network management (GP, AD, VB scripting, and so on). The company I work for has historically had their email held with their website host, rather than having MX records pointed at the company servers. This component should not change.

They have then been using a Linux box to gather their emails. A copy of Fetchmail polls the website at regular intervals and grabs the lastest emails, then delivers them into eXim. All this happens automatically on the Linux box (not my area of expertise).

The client machines are all running Outlook 2003, with IMAP accounts, which point to the IP of the Linux box.


The Desired Solution

This current setup works, but is not very user friendly to administrate. Additionally, there are a numebr of issues that crop up when you try to force a Linux box into an otherwise Windows network environment (my main setup is a bank of 5 servers, all running Windows Server 2003). Consquently, I want to replicate the function we currently have in a fully Windows environment.

Basically, something should grab our mails from the website on a regular basis and throw them into hMail, then my client machines should be able to conenct to the IP of my hMail machine via IMAP and get their mail locally.


Advice Needed

Ok, this is where I require assistance. I have a spare Windows 2003 Server box with plenty of space available. I have installed (but have not yet configured) hMailServer. What I now need is some kind of program - preferably free - that will replicate the job FetchMail was doing on the Linux box and will regularly dial our website, grab our emails, and deliver them to hMail.
I also need to know how to configure hMail, since it will not be required to do the job of a full mail server (there will be no MX records pointed at it, and so on).

Can anyone advise me?

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Setting Up a Windows Mail Server

Post by martin » 2009-07-21 13:38

hat I now need is some kind of program - preferably free - that will replicate the job FetchMail was doing on the Linux box and will regularly dial our website, grab our emails, and deliver them to hMail.
Not sure about "dial our web site", but you can set up external accounts in hMailServer which allows you to download messages from remote POP3 servers and store them in local IMAP accounts.

As for general configuration, there's a tutorial available in the documentation...

Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Re: Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-21 14:37

martin wrote:but you can set up external accounts in hMailServer which allows you to download messages from remote POP3 servers and store them in local IMAP accounts.
Ah, that sounds possible. That's all that Fetchmail does at the moment on the Linux box.

Where abouts in the documentation is the section covering this? I don't see it at first glance.


Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Re: Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-21 16:36

Thankyou for your help, Martin. Will read up and see how I get on.

Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Re: Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-21 17:09

Ok, can I please get some clarification? Everything I can see so far in hMail seems to suggest it expects MX records to be pointed at it, and I can't find anywhere anything that would let me connect to my website email host via pop3, then grab the contents of a particular mailbox.

This is infuriating, as reading up on hMail seems to suggest that it is going to not only do everything I need it to, but will do it well and very reliably, I just can't get the settings established! :x

Another issue seems to be the database. I know it comes with an inbuilt database, but I'm not so sure that it's going to be suitable. I have about 35 employees, and they rely heavily on email (several on large attachments). In addition, I have a lot of employees who nered to share mailboxes, hence the IMAP in the first place.

Can anyone please help?

Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Re: Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-21 17:13

Ah, think I've just come across the individual pop3 settings, contained within the settings for each mailbox account. Will start testing.

Would still greatly appreciate any help with getting the database properly setup, however.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Setting Up a Windows Mail Server

Post by martin » 2009-07-21 17:14

Suggest you install Microsoft SQL Server Express Edition and use hMailServer Database Setup to configure hMailServer to use it.

Keba
Normal user
Normal user
Posts: 126
Joined: 2009-04-11 11:43

Re: Setting Up a Windows Mail Server

Post by Keba » 2009-07-21 17:15

Tezcatlipoca wrote:Ok, can I please get some clarification? Everything I can see so far in hMail seems to suggest it expects MX records to be pointed at it, and I can't find anywhere anything that would let me connect to my website email host via pop3, then grab the contents of a particular mailbox.
You only have to have MX records point at your hMail server if you are accepting email from the Internet. If you are using it as a local mail server for internal clients to use, then you don't need those MX records.

This is based on the assumption you will send all email via the ISP host that you are also going to set up to check for POP3 mail from...
Tezcatlipoca wrote:Another issue seems to be the database. I know it comes with an inbuilt database, but I'm not so sure that it's going to be suitable. I have about 35 employees, and they rely heavily on email (several on large attachments). In addition, I have a lot of employees who nered to share mailboxes, hence the IMAP in the first place.
The database doesn't store the mail content, as that is stored as files on the file system (as well as attachments). You will need adequate disk space for those files regardless though, as they still take up room on the disk...
Keba

Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Re: Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-21 17:54

Keba wrote:This is based on the assumption you will send all email via the ISP host that you are also going to set up to check for POP3 mail from...
Quite right. The web host will still continue to be the central repository for our emails; I just want hMail to POP3 each mailbox and grab the data (thus allowing my Outlook 2003 clients to IMAP connect to the hMail server in my network), and will also push sent mail up to the website host.
Keba wrote:The database doesn't store the mail content, as that is stored as files on the file system (as well as attachments). You will need adequate disk space for those files regardless though, as they still take up room on the disk...
Er...now I'm totally lost. So what's the database setup for? Is it needed? The documentation seems to suggest that the database does hold the emails, and that if you have a lot of users or email heavy users you shouldn't use the inbuilt database.

I've tried to get things set up, but am still getting nothing. I've created a test account, then set it's POP3 settings to that recommended by my webhost. I think, but hav eno way to be sure, that hMail is going and grabbing the mail from the test box I've set up with the host, but I can't see any settings anywhere that tell me how to get Outlook 2003 connecting to the hMail server via IMAP to collect the mail.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Setting Up a Windows Mail Server

Post by martin » 2009-07-21 17:58

The database stores message meta info, such as sender, recipient, subject and a path to the file on disk. The rest of the message is stored in the file system.

> but I can't see any settings anywhere that tell me how to get Outlook 2003 connecting to the hMail server via IMAP to collect the mail.

That's because you should be looking in the Outlook documentation if you want info on how to set up Outlook. :) You've created an account with a password in hMailServer Administrator. This is the username / password you should use in Outlook. As server name, you should use the name / ip of the computer where hMailServer is running..

Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Re: Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-21 18:05

martin wrote:The database stores message meta info, such as sender, recipient, subject and a path to the file on disk. The rest of the message is stored in the file system.
Ok, and when I ran hMail I doubleclicked localhost. Does that mean it's automatically using its internal database?
martin wrote:That's because you should be looking in the Outlook documentation if you want info on how to set up Outlook. :) You've created an account with a password in hMailServer Administrator. This is the username / password you should use in Outlook. As server name, you should use the name / ip of the computer where hMailServer is running..
I've created a test mailbox, called test.user@. I've also created the mailbox at my webhost. hMail has it's settings configured to POP3 to my webhost and hunt for this users mailbox. This appears to be working, as I've sent test mails to it, and in hMail, the mailbox size is increasing.

However, I cannot get Outlook to connect. We already use IMAP accounts connecting to a server machine, so I'm familiar with the process. I can set the IMAP server to the IP of the hMail machine no problem, but can't find anything that specifically relates to a user name on the hMail settings for the test mailbox. Is the username the email address?

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Setting Up a Windows Mail Server

Post by martin » 2009-07-21 18:07

> Ok, and when I ran hMail I doubleclicked localhost. Does that mean it's automatically using its internal database?

No. hMailServer Administrator is a client which can manage a hMailServer server. Localhost in hMailServer Administrator just means that Administrator will connect to a hMailServer server running on local host. However, the Status page in hMailServer Administrator should show you what settings are in use.

> Is the username the email address?

Yes. The full email address, including domain name, is the user name.

Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Re: Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-21 18:18

>No. hMailServer Administrator is a client which can manage a hMailServer server. Localhost in hMailServer Administrator just means that Administrator will connect to a hMailServer server running on local host. However, the Status page in hMailServer Administrator should show you what settings are in use.

er...ok, the status base is MSSQL CE, but no server address or name. If I try to run the other program (hMail Database Setup) it asks me what type of database I want, then for a load to address details; none of which I have because I have no database. There doesn't seem to be anything straightforward that lets me set up the database that apparantly comes with hMail.

>Yes. The full email address, including domain name, is the user name.

I've tried that already and Outlook just errors out, telling me it's unable to download a folder (null) from the IMAP server, and folder Inbox. It looks like Outlook is trying to connect to the hMail box (and yes, there is total conenctivity between the two machines, zero firewalling, and full pinging capabilties), but failing for some reason.

Sorry to be such a newbie on this, but I'm increasingly convinced that hMail can answer all our email issues, if I can just get through this damn initial settings proceedure! If I can get at least one mailbox working, the others will be fine.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Setting Up a Windows Mail Server

Post by martin » 2009-07-21 18:24

> er...ok, the status base is MSSQL CE, but no server address or name.

That's because CE is Compact Edition, an in memory database run inside of hMailServer.exe. It's a database engine, but not really a server in the sense that it's listening on some TCP/IP address and port.

> There doesn't seem to be anything straightforward that lets me set up the database that apparantly comes with hMail.

Because it's already set up. If you can start hMailServer Administrator and bring up the Status page, you already have a database running.

> I've tried that already and Outlook just errors out, telling me it's unable to download a folder (null) from the IMAP server, and folder Inbox.

Well, then it's at least able to connect. Are you using an english version of Outlook? In the account settings there's a setting called Inbox root path or something similar. Try entering INBOX in that field.

Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Re: Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-21 18:35

>Well, then it's at least able to connect. Are you using an english version of Outlook? In the account settings there's a setting called Inbox root path or something similar. Try entering INBOX in that field.

Yes, English version. This is Outlook 2003. I'm now convinced that the hMail bit is working properly, albeit in a very crude basic form. The test mailbox appears to be getting large as I sen test emails to it, so I'm happy the POP3 is functional.

I think Outlook is connecting at some core level, since it no longer questions the username or password, and, oddly, it appears not only to be trying to download mail from the hMail machine, but also to be checking for mail in subscribed folders, which isn't something I've seen before and not something our current IMAP solution does (at least, not obviously).

In Outlook, I have the IMAP server set as the IP of the hMail machine (and JUST the IP, no ports or anything), whilst the username is the full email address (which is also letter for letter the name of the test mailbox I've established). The password is identical to the server one, so I know it functions.

The hMail machine is a Server 2003 OS, whilst the client is XP Pro, if that makes a difference?

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Setting Up a Windows Mail Server

Post by martin » 2009-07-21 18:38

So did you try to enter INBOX in o the field I suggested?

Another thing you can try is to temporarily use Outlook Express again just to rule out hMailServer....

> The hMail machine is a Server 2003 OS, whilst the client is XP Pro, if that makes a difference?

Doesn't matter.

Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Re: Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-21 18:44

>So did you try to enter INBOX in o the field I suggested?

First thing I tried, nothing. It still refuses to connect.

>Another thing you can try is to temporarily use Outlook Express again just to rule out hMailServer....

Just tried that, nothing. OE gets set up, then asks to check the IMAP folders so it can synchronise. when doing this, it tells me that it cannot connect to the IMAP server at all and I see no folders.

Again, I can ping between these two machines just fine.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Setting Up a Windows Mail Server

Post by martin » 2009-07-21 18:48

This is really weird..

1) Enable IMAP logging in hMailServer
2) Reproduce the problem using Outlook Express
3) Post the contents of the log here.

Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Re: Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-21 18:52

ahem...yes...it..ah...helps if you check the hMail service is actually running on the hMail machine. Ahem. Needless to say, Outlook Express works perfectly now :oops:

Still the same problem with Outlook proper, but since OE is now running, and receiving my test messages, I'm 90% of the way there (hopefully). Now I just have to get Outlook connecting properly!

Have just tried importing the OE account into Outlook and the same problem; it point blank refuses to connect and download the folders. the problem is definitely - unsurprisingly - Outlook.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Setting Up a Windows Mail Server

Post by martin » 2009-07-21 18:58

Well, Outlooks IMAP support isn't good, but not being able to download folders seems a bit extreme. Do you still have INBOX set as root path? If not, add it. If you have, remove it. See if that makes any difference.

If you still have problems with Outlook, do the logging thing I suggested.

Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Re: Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-21 18:59

Ah! Just forced Outlook to change it's root path. Trying INBOX didn't work, but have just changed the root path to the IP of the hMail machine and Outlook 2003 now conencts and can send and receive mail via my hMail server just fine!

Thank you VERY much for your help; it is greatly appreciated. I feel I've now learnt enough of the basics to try testing a few more mailboxes.

One last question I have; since the inbuilt database isn't that large, do I need to change to a proper one when I'm ready to go live? I have about 35 employees and probably somewhere in the region of 60-80 emails sent in a day, and probably about 150-200 received, across the business.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Setting Up a Windows Mail Server

Post by martin » 2009-07-21 19:02

> Trying INBOX didn't work, but have just changed the root path to the IP of the hMail machine and Outlook 2003 now conencts and can send and receive mail via my hMail server just fine!

Uhh OK. That I don't understand. It should work fine to leave it empty. I've never had to specify INBOX myself except for when I was using a Swedish version of Outlook. It could be that some regional options or similar stuff on your computer affects this.

I suggest you install Microsoft SQL Server Express Edition before going in production (and a bit before that as well so you have time to test it) if email messages are important to you. SQL Server Express is more mature than Compact Edition, and Microsoft has better support for it. May be valuable if you run into problems...

Tezcatlipoca
Senior user
Senior user
Posts: 309
Joined: 2009-07-21 12:33

Re: Setting Up a Windows Mail Server

Post by Tezcatlipoca » 2009-07-22 12:16

How do I set up a new database? I have SQL Server Express 2005 installed, but it only seems to want to conenct to a database, rather than create a new one. The hMail database setup program seems to want to do the same.

Post Reply