Skip to content. | Skip to navigation

Navigation

Personal tools

Mail Applications

Building a mail system

Introduction

This guide describes how to build a mail system to handle incoming mail for multiple domains and serve the mail back up through IMAP. We'll throw in some good things like anti-virus and anti-SPAM measures.

In particular, we'll be using Postfix to handle incoming email and Cyrus for IMAP support. As we're too cheap to afford commercial tools we'll use ClamAV anti-virus and SpamAssassin anti-SPAM.

We'll handle multiple email domains with a view to providing IMAP accounts accessed as user@domain.

There are some complications to our simple vision largely in terms of the concept of the box's own domain (or default domain). Your computer will have a (fully qualified!) hostname which means it has a domain, eg. mycomputer.example.com has the domain example.com. Fair enough. If we also want to handle email for its two sibling domains, example.org and example.net then things should be relatively straightforward. Except they aren't. The two non-default domains are handled differently to the default domain and the default domain is handled differently within the various applications.

If you want to handle domains in a fairly automated way (ie. you might have many domains under your control and want things to run smoothly) you may want to consider having your default domain (and thus your computer's own hostname) being a special domain that isn't treated like the others. That way, if you want to check your configuration files or on-disk image 'looks right' you can quickly see all of your email domains in one place (directory or config file) otherwise you need to remember to check in multiple places.

Watch out for default domains!

Document Actions