Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: HOWTO: Use hMailServer to share email across a home network
PostPosted: 2007-01-13 12:03 
New user
New user

Joined: 2007-01-13 10:51
Posts: 3
Introduction
In this how-to, I will be describing how to set up hMailServer for a slightly different purpose. Rather than being a normal mail server, it will be performing more local duties in allowing shared access to a single ISP-provided email account. Starting from a single PC running Thunderbird to access a POP account on the ISP, we'll finish with shared email folders that any client in the home network can access simultaneously, without losing the existing emails.

Background
When a home network grows from a single PC connected to the internet to several machines connecting through a router, it can be a pain to have a single PC nominated as the "email reading" PC. I might want to access email from any of the connected PCs on the network. There is always webmail, I suppose, but it wouldn't be possible to get at the existing emails on that, and is never really as convenient as client-side access, and the limitations on storage space and bandwidth may be restrictive.

The solution, then is to run an IMAP server on one of the PCs, have that access the POP account on the ISP, and have any client on the home network access the IMAP folders to get at the email. The existing emails can be easily migrated into the new IMAP folders for all clients to access.

Procedure
First, download and install hMailServer on a PC that will be most often turned on. If you have one that is always turned on, so much the better, as mail will only be available to the other PCs in the network while it is on.

After downloading and installing hMailServer, the next step is to add a domain. It isn't going to be acting as a mail server for that domain, so for convenience enter the ISP POP account server as the domain. For this example I'm going to assume the POP account is username@isp.com. So, the domain would be "isp.com". (Note, in this example hMailServer is not being used for SMTP. If, for some reason, you want to route your outgoing mail through hMailServer too, rather than directly to your ISP, then you should use the "example.com" domain instead.)

Next, add a user to that account, which again for convenience, I'm going to keep the same as the POP account username, which would make it "username". The account therefore becomes "username@isp.com".

Once the account is added, go to the External Accounts tab and add a new External Account. This will be the ISP POP account, so enter all the details for it there, the same as they are currently configured in the email client. I will assume it is Thunderbird, for this example. Leave the option to delete mails on the server to "Don't delete" for the time being, to avoid anything falling between the cracks while we're setting things up.

Next, expand the "Settings" node and click on the "Protocols" node. Uncheck SMTP and POP servers, as we won't be using those, just leaving the IMAP server checked.

Now, to set up IP Ranges. These can be found under the "Settings\Advanced\IP Ranges" node. Select the existing one called Internet, and uncheck everything - we don't want this server to be internet accessible at all. Click on the "IP Ranges" node again, and Add a new range. Give it a name like "Home Network", and the IP range of your network.

This will usually be something like 192.168.1.0 to 192.168.1.255. If you aren't sure, then go to a command prompt and type "ipconfig" to discover your IP address. For most home networks set up to access the internet through a router, it should start with 192. The range would then usually be the first 3 bits of the IP address, with 0 to 255 for the last bit. If your network setup is more unusual, then determining your range is outside the scope of this howto. As a last resort, you could leave it as an internet range of 0.0.0.0 to 255.255.255.255, and rely on the firewall and NAT to prevent access from external connections.

In any case, once the new range is in place, give it a priority of 25 (shouldn't matter, as there aren't other ranges anyway), then check all the checkboxes. Most of them won't apply anyway, as hMailServer won't be acting as a mail server, but it won't do any harm to have them checked. At the least, the IMAP checkbox must be checked.

Now we must open the port in the local firewall, if there is one. Port 143 TCP must be opened. If you are using Windows Firewall, this can be done by going to Control Panel, then Windows Firewall, clicking on the Exceptions tab, then clicking the Add Port button. For the name, enter something descriptive like "IMAP", then for Port number enter "143", and make sure TCP is selected. Click the "Change Scope" button, and choose the "My network (subnet) only" option. After OK'ing all the way out, the port should now be open. If you are using any other local firewall, then consult its documentation on how to open a port.

The next step is to configue Thunderbird to use the new account. To do this, you will need to know your IP address on the internal network. This can be found using the ipconfig command as I described above. Sometimes home networks are set up to assign IP addresses by DHCP, which means your IP address won't be fixed. In this case you should give the PC that has hMailServer on it a fixed IP address, which is out of the scope of this howto. There are other guides on how to do this available, though.

To configure Thunderbird to use the new account, choose to create a new Mail account, enter your name and email address (username@isp.com) as usual, then select "IMAP" as the type of incoming server. As the name of the incoming server, enter the IP address of the PC running hMailServer, 192.168.1.201, for example. For the username, enter your email address (username@isp.com) again. Give the account a name, and you're done. This should be done on every PC you want to be able to access the email on. If you use Junk mail controls, then make sure these are set up for the new IMAP account in the way you like them.

To improve IMAP performance in Thunderbird, it can also be worthwhile going to Options, Advanced, General, and clicking on Config Editor. Enter "mail.imap.fetch_by_chunks" into the filter, then double click on it to set it to "false".

If you are setting up a new Thunderbird installation you will also be asked for the SMTP server settings. These should be entered just as given to you by your ISP, or copied from the existing Thunderbird installation you were using for mail.

It is usually worth going to Account Settings for the new IMAP account and making sure the Copies & Folders settings are set up right. I would recommend that any copies you keep, such as drafts, and sent mails, go in folders on the IMAP account, rather than Local Folders, so that they are shared. I would also recommend setting the "Check for new messages every" setting under "Server Settings" to be the same value as you set hMailServer to check for external mail when setting it up.

The next step is to migrate your existing mail into the shared IMAP folders. To do that, go to the PC that has the original ISP POP email account in Thunderbird on it. Go to Account settings, and for the original ISP POP email account, under "Server Settings", uncheck the "Check for new messages" checkboxes. Receiving new mail will just get in the way, until migration is complete. Finally, drag and drop each of your mail folders from under your existing account to the under new IMAP account. I would recommend holding down the Ctrl key while doing so, to copy instead of move, just in case anything goes wrong half way through. Don't forget to do your Sent folder too, and any other folders that need to be shared.

Copying all the mail across will probably take a long time, and suck up CPU cycles like a monster.

Once it is done, and you've checked you can access the mail in the IMAP folders, you can delete the original ISP POP account. If you had it set to deliver mail to Local Folders, you can also delete all the mail you've just copied across out of them too. Unfortunately Local Folders can't be removed, but can be collapsed and ignored.

The last step is to go back to hMailServer, go to "Domains\isp.com\Accounts\username@isp.com", and select the External Accounts tab. Double click on the external account, and change the Delete messages setting to "Delete messages immediately".

Conclusion
Once this has been set up, your mail should be accessible and synchronised across all clients on your home network, even if they are using different mail programs. Note that it will not share your address book, you will have to do that separately.

The only disadvantage of this system that I have found is that the Get Mail button no longer actually gets mail; there is no way to force a check of the ISP POP email account sooner than the interval specified. This can be frustrating if you are chatting with someone who sends you something by email and expects you to receive it immediately.

I hope someone finds this helpful, as when I was looking for information on how to share email folders across a network, I would really like to have found something like this. If more experienced hMailServer or network people would like to contribute improvements or suggestions, those would be welcome too!


Last edited by AlexV on 2007-02-20 09:56, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: HOWTO: Use hMailServer to share email across a home netw
PostPosted: 2007-01-15 02:57 
New user
New user

Joined: 2006-09-29 07:05
Posts: 8
Location: Adelaide, South Australia
Quote:
The only disadvantage of this system that I have found is that the Get Mail button no longer actually gets mail; there is no way to force a check of the ISP POP email account sooner than the interval specified. This can be frustrating if you are chatting with someone who sends you something by email and expects you to receive it immediately.


Just change the "Minutes between download" setting to 1. This will download new mail every minute. The most you will wait to receive an email is 1 minute. This should alleviate this problem.

_________________
Greg Donhardt

Apache 2.2.3
hMailserver 4.2.2 - Build 199
Windows XP SP2


Top
 Profile  
 
 Post subject:
PostPosted: 2007-01-15 10:44 
Senior user
Senior user

Joined: 2005-07-29 16:18
Posts: 9729
Location: AFK
You shouldn't really set that to below what it is set at by default. The reason for this is if you have a big download that takes more than a minute to get then you would get mailbox locked errors.


Top
 Profile  
 
 Post subject:
PostPosted: 2007-01-16 06:43 
New user
New user

Joined: 2006-09-29 07:05
Posts: 8
Location: Adelaide, South Australia
Quote:
You shouldn't really set that to below what it is set at by default. The reason for this is if you have a big download that takes more than a minute to get then you would get mailbox locked errors.


I hadn't really thought about that. I think I have mine set for about 10 mins or so![/quote]

_________________
Greg Donhardt

Apache 2.2.3
hMailserver 4.2.2 - Build 199
Windows XP SP2


Top
 Profile  
 
 Post subject:
PostPosted: 2007-02-19 20:45 
Normal user

Joined: 2005-07-27 19:20
Posts: 55
One thing worth mentioning is that setting the domain to "isp.com" is not a good idea. If you want to sent email to someone who is using the same ISP as you, he/she will never get the email. hMailserver will try to deliver the mail to an account that goes by that persons username on your local server (as you have configured it for your ISP's domain!). Obviously it will not find that user and deliver the mail to the catch-all address you've configured. The intended recipient will never see the mail.

Better is to confgure your server for the domain "example.com" this is a domain that noone uses.


Top
 Profile  
 
 Post subject:
PostPosted: 2007-02-19 20:59 
New user
New user

Joined: 2007-01-13 10:51
Posts: 3
Good point, if you are using hMailServer as a SMTP server too, I hadn't thought of that. The setup I described was using hMailServer for incoming mail only, outgoing mail would continue to go directly through the ISP SMTP server, and would be unaffected by any hMailServer settings.


Top
 Profile  
 
 Post subject:
PostPosted: 2007-02-20 00:01 
Normal user

Joined: 2006-11-30 07:13
Posts: 135
Location: Australia
AlexV wrote:
...outgoing mail would continue to go directly through the ISP SMTP server, and would be unaffected by any hMailServer settings.

I believe you should do a few tests yourself as this isn't how hMailserver works. EG if you sent an email to say... "friend@isp.com" and you have a hMailserver domain setup using "isp.com", your message will not leave your server as it would be considered to be local. IE it doesn't continue directly to the ISP SMTP server.

You can check the default hMailserver behaviour by viewing the logs after enabling SMTP logging and sending a test email out to "someone@isp.com". From the logs, you will find that the test message does not leave your server.

I would suggest amending this howto to use a dummy domain like the one Pieter mentioned. EG example.com


Top
 Profile  
 
 Post subject:
PostPosted: 2007-02-20 09:53 
New user
New user

Joined: 2007-01-13 10:51
Posts: 3
Sorry, I didn't make myself clear. Under the setup I described outgoing mail would not go through hMailServer at all. hMailServer would not be running the SMTP service. The email client would send mail through the ISP directly.

I will amend the how to to clarify this, and add a warning for using hMailServer as an SMTP server too.


Top
 Profile  
 
 Post subject:
PostPosted: 2007-02-23 01:58 
New user
New user

Joined: 2007-02-23 01:44
Posts: 1
What Alex described is exactly what I did with another mail server program (commerical program, free for up to 5 users), for exactly the same reasons. The Mail Client (Thunderbird) is set to use my ISP's SMTP for outgoing mail. there is no issue for example sending email to my brother interstate on the same ISP.

I also use this to check my emails on my home PC via webmail. The only downside is that using the webmail I can't actually reply to the emails because the webmail is not attached to a valid running smtp service. In my search for a workaround I came across hmail and it looks like a great program. I am pretty sure my ISP blocks Port 25 to prevent ppl running their own mail servers though. I believe there are ways around this ... so the search goes on.


Top
 Profile  
 
 Post subject:
PostPosted: 2007-02-23 08:41 
Normal user

Joined: 2006-11-30 07:13
Posts: 135
Location: Australia
Seb wrote:
I also use this to check my emails on my home PC via webmail. The only downside is that using the webmail I can't actually reply to the emails because the webmail is not attached to a valid running smtp service. In my search for a workaround I came across hmail and it looks like a great program. I am pretty sure my ISP blocks Port 25 to prevent ppl running their own mail servers though. I believe there are ways around this ... so the search goes on.

Well by setting up the hMailserver SMTP relayer to be your ISP mail server, you can get your webmail to send via the SMTP service. You just need to avoid using your ISP domain name in your hMailserver domain setup. It isn't a requirement to have a real domain setup on hMailserver. You can use any domain that doesn't exist on the internet. For example, domain.local would be fine. All you need to do in your webmail client is to set it to send as another identity. IE me@isp.com
http://www.hmailserver.com/documentatio ... rence_smtp

Alternatively, you can configure your webmail server SMTP settings to send through your ISP mailserver. Just change the setting for SMTP server from "localhost" to your ISP smtp server.


Top
 Profile  
 
 Post subject: How to use this set-up to send? Dial up connection
PostPosted: 2007-02-28 11:18 
New user
New user

Joined: 2007-02-23 09:47
Posts: 3
Location: Chitungwiza, Zimbabwe
Hi,
I have set up three email accounts with this system on my network, and they receive fine. However, I can not seem to find a way to make them send mail, except for the computer that dials in to the Internet. I woulod appreciate any help on this.
Set-up:
hMail 4.3b248 on computer with dial up connection, set up as IMAP and SMTP and collects mail using POP3 external accounts. The ISP blocks port 25, so I have tried using SMTP relayer, using the same settings we previously used when directly connecting to the Internet, but no success.
Two computers are using Outlook Express, and one is using Thunderbird.
My goal would be to have these accounts send to the outbox, which automatically gets sent whenever we connect to the Internet.
Thanks for your assistance, and thanks for a great program (even if I can't quite figure it all out!)


Top
 Profile  
 
 Post subject:
PostPosted: 2007-02-28 20:21 
Normal user

Joined: 2005-07-27 19:20
Posts: 55
Using hMailserver administrator you should set the SMTP relayer which you can find under Settings>Protocols>SMTP.
If I understand correctly you tried this already. Maybe add authentication data? In any case maybe the logfile can help to find out the problem.
Please start a separate thread for that.


Top
 Profile  
 
 Post subject: Re: HOWTO: Use hMailServer to share email across a home network
PostPosted: 2009-04-07 19:54 
New user
New user

Joined: 2008-02-08 05:21
Posts: 27
Hello.

I don't see why you could not use your ISP as the domain and then set up a new route to the ISP. However maybe I'm missing something.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 


Who is online

Users browsing this forum: No registered users and 2 guests



Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group