Drupal + Postfix Integration Under Ubuntu 8.04 (Hardy)

Version: 1.02
Author: Alex Saavedra
Last Update: October 9, 2008
License: © 2008 Alex Saavedra. This document is published under the terms of the GNU General Public License (http://www.gnu.org/licenses/gnu.html).

This document is derived from Christoph Haas’ tutorial “Howto: ISP-style Email Server with Debian-Etch and Postfix” (http://workaround.org) and Falko Timme’s tutorial “Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.04 LTS)” (https://www.howtoforge.com). The associated Mailfix Drupal module must be installed as part of this tutorial.

It will guide you through the necessary steps to configure a Drupal driven Mail server. Provided features:

  • Drupal managed email accounts
  • Support for virtual domains
  • Automatic forwarding
  • Postfix quota support
  • Silent BCC monitoring
  • Other features: anti-spam, anti-virus



This tutorial is the result of many attempts to replace a couple of Postfix mail servers which were maintained with text files. Every time I had to create or drop an account I was required to vi those files, then reload the Postfix configuration. Same thing when users went on vacation (automatic forwarding) or supervisors asked for BCC monitoring. Yep, not funny.

Then Drupal was introduced to our corporate environment to manage our Intranet. The result was a total success. I thought how great it could be if we could manage our mail users from this same location.

So I went through such superb works from Christoph Haas (http://workaround.org/articles/ispmail-etch/) and Falko Timme (https://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu8.04).

Then I found a great Drupal module from Thomas Barregren (http://drupal.org/project/mailserver) which had almost all the functionality we required, and was based on Christoph Haas’ work for the Postfix/MySQL integration. We thoroughly tested and reviewed this module for a couple of weeks. Unfortunately we still had to maintain the mail quota, forwarding and BCC monitoring part by hand.
Inspired by such awesome work, we finally decided to write a Drupal 6 module in order to keep all things in one place.

This is how this tutorial and its associated Drupal Mailfix module came to life.


Preliminary Tasks

First of all you need to install Linux on your target machine. We installed Linux Ubuntu 8.04 Server.

Select the following software packages:

  • OpenSSH server

Ensure that your IP will always be the same (fixed IP, or DHCP + IP reservation).
Write down your installation credentials:

Credentials Sample Settings

user: someuser
password: opensesame


user: root@localhost
password: opensesame

Drupal database: drupal_example_com
user: drupal_example_com@localhost
password: opensesame

Drupal user: admin
password: opensesame

Once your system makes a fresh boot to the newly installed OS, all tasks will require root privileges. Thus you should start a root session right away:

sudo -i
Share this page:

0 Comment(s)