[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

This is an old revision of the document!


Creating a Virtual Mail Server with Postfix, Dovecot and MySQL

This article is under construction and not complete! Please return later…

This article shows how to build and set up a secure virtual mail server using Postfix, Dovecot and MySQL.

Because the build and installed platforms may very likely be different, and the configuration can seem complex to those not familiar with postfix, dovectot and mysql, I have organized this article in a way that will help separate and test individual tasks, hopefully without losing your way!

The article has been written as the result of my own experience in setting up a virtual mail server on my own Linode.com VPS, but I have avoided many overt references to Linode.com specific tools or configurations, so it should be easily adapted for any platform. The only Linode.com reference will be to list a few additional packages that will be needed for their Slackware 14.1 base.

Our Target Virtual Mail Server

What we mean by virtual mail server is that mail boxes need not correspond to user accounts on the machine, but may instead be virtual users. This allows for serving mail for many mail boxes and across multiple domains if desired.

For security we will configure Dovecot to provide authentication for Postfix via SASL based on virtual mail box credentials. We will also require TLS/SSL for all user access, and of course will assure that it does not turn into a spam serving open relay!

To get started you simply need a full Slackware 14.1 base installation, with updated security patches, particularly for bash, openssl, openssl-solibs and gnutls.

If you are installing to a Linode.com VPS with their Slackware 14.1 base, you will need to add a few missing packages in addition to mariadb, dovecot and postfix. During my own set up (which includes fail2ban, not covered here) I needed to add: db48, cyrus-sasl, libaio, libxml2, pidentd and sqlite

There are many parts to our virtual mail server which will be covered in separate sections. But the best way to organize them all is with a simple graphic showing the major installed components and their relationships. Figure 1, below, represents an overall view of the target virtual mail system described by this article.

Figure 1: Virtual Email Overview

Figure 1 provides our todo list for installing this virtual mail server.

DNS and MX records

In order for your mail server to be found on a wider network, you must correctly configure your DNS and MX records for your host.

The specifics of doing that are outside the scope of this article, but are generally not difficult for an internet facing host. If your system is a hosted platform such as a VPS, then the provider will supply the tools and guides for doing so.

So check that your target host's DNS and MX records are correctly configured, and that the machine is reachable from the wider network to which it belongs, or from the internet.

 howtos:network_services:postfix_dovecot_mysql ()