Feature Last week, I explained the reasoning behind setting up your own mailserver, and the choice of software that I'll be using for it. This week, it's time to get hands on and show you how to do it. One word of advice, though: this is my configuration, and there are lots of options for tweaking, not to mention different ways to do it.
This week: Setting up the basics of your mail server
There's quite a lot to set up, so we'll take this in stages, building up from the basics, and the full spam and virus filtering will be in part three. Some elements, like setting the BIOS on your computer to allow installation of OpenBSD from USB or CD, are up to you.
It's also worth noting that for now, I'm going to work on the assumption that you have a fixed IP address and your ISP isn't blocking ports. There are workarounds for that, and you'll find plenty in the comments on last week's piece. Take a look, also, at some boutique ISPs who won't grumble about this sort of thing.
Previously, on The Last Post...
To recap, what we're going to set up here is an email server that provides POP and IMAP services for your (and your friends, family, pets, etc), based on the Dovecot POP/IMAP server, with Postfix as the Mail Transfer Agent, supplemented by anti-spam and anti-virus tools. All of this will be running on the OpenBSD platform. You can use your favourite flavour of Linux if you prefer, but some of the instructions will be slightly different.
First, catch your operating system. Even if you've never installed OpenBSD before, it's pretty straightforward. Assuming you're using an x86 chip, you'll find full instructions here. For the Revo One installation, I started with the miniroot57.fs image on a USB stick.
Boot your PC (or VM) from one of the OpenBSD install images
Initial setup of OpenBSD is very simple, and for the most part, you can accept defaults. You'll be prompted for a root password, then asked if you want sshd to run by default. Choose yes for that, and create a first user. I recommend not bothering to install X Windows, to save space.
Setting up the root disk used to be the trickiest part, but here, again, you can simply choose to use the whole drive and let the installer use the Auto Layout option. You should end up with a nice big /home partition; on my 256GB drive, it allocated around 187GB. That's where all the mail delivered to users will end up, so it needs to be a fair size. Next choose http installation, and unselect the X and games packages to save space.
For much of the installation, you can just accept defaults
Choose “done” when all the install sets have been added, and reboot when prompted. The observant will notice I'm using a VM in the pictures here – that's just to make screenshots easier. The process is exactly the same on real hardware like the Revo.