Part Five: Configuring SpamAssassin and Fetchmail

This is the last part of the tutorial on installing a mail server, refer the overview, or hit the tutorials menu at the top, and look at the mail server tutorial category.

In this section, I explain how to configure spam filtering using spam assassin, and how to configure fetchmail to go and get your mail from an existing POP3 isp mail account.

I use fetchmail in this way to avoid making my mail server the primary delivery location for my domain mail.  If I was a bit more confident in the uptime of my ISP and my servers I could just have my mail all come directly to my mail server, but for now I’m choosing to have it delivered to my ISP (who are pretty much always there) rather than have it bounce when my server isn’t there.

This tutorial assumes you’ve completed parts two, three and four, so you have a virtualised mail server that has Exim running on it to deliver mail into a mail box that is in Maildir format in /home/<user>, and dovecot serving that mail as an imap server.  So, let’s get on with the install.

Continue reading

Advertisements

Part Four: Configuring Dovecot for IMAP connections

This is the fourth part of the tutorial on installing a mail server, refer the overview, or hit the tutorials menu at the top, and look at the mail server tutorial category.

In this section I explain how to install Dovecot to expose your mail directory to your various client applications (iPhones, iPads, laptops and PCs), and have that mail kept in synch across all those devices.  To do this, we use Dovecot as an IMAP server, IMAP being a protocol that allows mail clients to add folders, move around mail messages and do the usual mail stuff, all working against a shared server mailbox.

This tutorial assumes you’ve completed parts two and three, so you have a virtualised mail server that has Exim running on it to deliver mail into a mail box that is in Maildir format in /home/<user>.  So, let’s get on with installing dovecot.

Continue reading

Part Three: Configuring Exim to accept and deliver mail, and for secure outbound SMTP mail, including OSX connectivity

This is the third part of the tutorial on installing a mail server, refer the overview, or hit the tutorials menu at the top, and look at the mail server tutorial category.

In this section I explain how to install Exim on the vanilla virtual machine.  Exim accepts mail from the outside world and delivers it to your mailbox on the local server, and accepts SMTP mail from you and sends it to the outside world.  The acceptance of SMTP mail from you needs to be secured, as unsecured SMTP servers can be used by spammers to send spam.

There are a handful of decisions that need to be made / settings that need to be configured in the setup of Exim:

  • How you’ll authenticate users.  I’m choosing to require each user to have a Linux logon to the server, which makes the authentication reasonably easy to setup, but does require that each user has an account on this machine.  This works fine for a small home server, for something larger you’d probably want to look at an LDAP.  On my personal install I actually use NIS+ to synchronise users across my machines, I’m not going through the setup for that here.
  • Where mail will be stored.  In general the options are /var/mail, or /home/<user>.  Since I’m requiring each user to have their own account on this machine anyway, I may as well use /home/<user>.  If you were using LDAP for your users you might make a different choice.
  • What format mail should be stored in.  The original Unix format was mbox, in which each folder is a single file.  Whilst it has indexes and the like for performance, it just feels to me like a single file for your mailbox is going to lead to trouble.  The newer format is MailDir, where each folder is a directory and each message a file in that directory.  This seems better to me, so I’ve used it.  Note there are other, less standard, formats available.  Since the format we use needs to be valid for both Exim and Dovecot, I’m trying to stick to the standard formats.

So, let’s get on to the install.

Continue reading

Part Two: Install virtualisation and a base virtual server

This is the second part of the tutorial on installing a mail server, refer the overview, or hit the tutorials menu at the top, and look at the mail server tutorial category.

In this section, I explain how to install the virtualisation software on an existing Debian (or, possibly, Ubuntu) server, and create a new virtual machine. I’m assuming that you want to use lvm as the backing store, if you don’t want to do this then you can set up the virtual within a LVM volume or a file, I note where you’d do things differently if you wanted to do that. You can also use drbd as a backing store to allow you to run the same mail server across two different servers without data loss, described here. I’ll mention the point where you should look at that post if you want to do this.

You should check that you’ve installed the right OS version for your base operating system – whilst you can run virtualisation on a 32-bit Linux kernel, it’s generally better to run on 64-bit. A 64-bit host can support 32-bit guests, a 32-bit host cannot support 64-bit guests. There are also memory limitations on 32-bit that get annoying (although unlikely to matter for a mail server).

I also assume that you have a gui environment (an x server, and KDE, Gnome or xfce installed). You can do all this from the command line, but you’ll need to derive the commands for that yourself. Note that you can install the virt-manager package on another machine to manager your server, so you just need to have the gui environment somewhere, not necessarily on your server.

Continue reading

Part One: Install a secure Debian Wheezy imap mail server into a virtual using Exim, Dovecot, Fetchmail

So, I’ve seen a number of people visiting to look at this post, which was, to be honest, not much of an instruction list.  Given that there is interest (at least relative to the lack of interest in the rest of my blog!!), I’m making a much more detailed tutorial that takes you through step by step how to install a virtual machine on an existing server, install Debian Wheezy into that virtual, then install Exim, Dovecot and Fetchmail to create a secure server that you can use for personal IMAP e-mail.

This post provides an overview of the components, what each does, and why I chose them.

Continue reading