Setting Up A Mail Server On Linux

3 Comments | This entry was posted on Jun 03 2009

I have found that most people have found my blog by searching for how to set-up a mail server on Linux so I throught I should elaborate on how I set mine up.

The tutorial

I first followed the guide supplied by Slicehost but found that it is not complete. I then discovered and followed an article from which I recommend.

This article is easy to follow and gives you a great understanding of what each step does.

It shows you how to set-up a mail server for multiple domains and setting quotas for each address. When complete you can access your mail over TLS or SSL so that it is encrypted. The one downside I found though is that you can only apply one certificate to all domains.

Here are some important pieces in more detail:

Creating Certificates

One thing left out of both tutorials was how to create your own Courier certificates for receiving email. Without creating your own, you are left with a warning that the certificate is for localhost every time you connect to the server. I found a tutorial from another blog that explains how to create your own self signed certificate. You will still get a warning but your mail client should allow you to accept that self signed certificate permanenetly.

Setting Quota

The tutorial from unix-tutorials also shows how to set quotas for email address. Along with this you will receive (via a cron job) an email advising of any mail accounts approaching their quota.

Slow performance

One issue I did have in all this was the slow performance this caused on my slice. With all the Spam detection and Anti virus running in the background my websites were crawling to a halt. This was because my slice had only 256MB of RAM. It would be fine if I upgraded but at this time I can do without the extra filtering on the mail. For now I have had to disable the spam filter and and anti-virus until it comes the time to upgrade the slice.


In all this is a valuable experience for anyone who wishes to learn more about Linux and wants more control of there server and services.

Setting Up Your Own Virtual Server With Slicehost

0 Comments | This entry was posted on Apr 16 2009

I have been working with Linux and web development for over seven years and in this time I have used several hosting companies as well as set-up some development servers at home in order to host and develop my websites. I had recently decided to take the plunge into getting my own virtual server account so I would have a live environment where I would have full control.

I chose Slicehost as my provider as I have used them in the past at work and found them to be reliable and the control panel and service to be exceptional. As with this type of virtual host you are given a completely new install with bare services running. This means that as a web server you need to manually install everything from Apache, MySQL and PHP manually. Also you will probably need to install a mail service.

The tough part for me was installing and configuring the mail. This is not something I do with my dev boxes at home. This was a bigger learning curve than I imagined but very rewarding. The greatest part with virtual hosts is that if you completely screw up, you can easily choose to rebuild your slice and start again from scratch.

Also through the slice manager you can easily configure DNS for any domains and subdomains hosted on the server.

Anyway, some of the best things I have learnt from the experience are:

  • Setting up a mail server with encryption and smtp authentication for imap accounts using mysql.
  • Setting up the firewall using iptables.
  • Learning how to login over ssh without passwords.
  • Setting up a Subversion server with SSL encryption.

It has been very satisfying to step away from the traditional hosting companies and have full control over my hosting. I recommend anyone else with Linux experience who is thinking of getting a virtual host with full root access to give it a go. There are some good ones about and the experience gained are better than I would have hoped.