Drupal + Postfix Integration Under Ubuntu 8.04 (Hardy) - Page 2

Install All Required Packages

You can use either apt-get or aptitude. We prefer aptitude. First of all update your repository tree ("u" command). Then ensure that the following packages are installed:

amavisd-new apache2 build-essential cabextract clamav-daemon debhelper dovecot-imapd dovecot-pop3d dpatch elinks fakeroot libcdb-dev libclass-dbi-mysql-perl phpmyadmin libapache2-mod-php5 libdb-dev libgdbm-dev libldap2-dev libmysqlclient15-dev libpam-mysql libpam-smbpass libpcre3-dev libpq-dev libsasl2-2 libsasl2-modules libsasl2-modules-sql libsasl2-dev libssl-dev mutt mysql-server nomarch openssl pax php5 php5-dev php5-mysql php-pear postfix postfix-doc postfix-mysql sasl2-bin spamassassin squirrelmail squirrelmail-decode vim vim-runtime

When asked about configuration options proceed as follows (replace example.com with appropriate domain):

MySQL root password: opensesame
Postfix Configuration: Internet Site
System Mail Name: example.com
phpMyAdmin Configuration: apache2

If you are a vim user, you may want to enable vim syntax highlighting by uncommenting the syntax on line in /etc/vim/vimrc configuration file:

vim /etc/vim/vimrc

  syntax on


Apply the Quota Patch to Postfix

We need to download Postfix sources, apply the quota patch, build new .deb packages and install them.

cd /usr/src
apt-get source postfix

Now we download the Postfix Virtual Delivery Agents (VDA) patches by Anderson Nadal (http://vda.sourceforge.net/). Keep sure you are downloading the appropriate version for your server. If in doubt, the following command will display your Postfix version:

postconf | grep ^mail_version

 mail_version = 2.5.1

In our case we download the patch for version 2.5.1:

wget http://vda.sourceforge.net/VDA/postfix-2.5.1-vda-ng.patch.gz
gunzip postfix-2.5.1-vda-ng.patch.gz

This should unpack the postfix-2.5.1-vda-ng.patch file which must be applied in order to have support for user quota.

cd postfix-2.5.1
patch -p1 < ../postfix-2.5.1-vda-ng.patch

If you see the following message once the compilation ends, don’t worry, it’s as expected:

dpkg-buildpackage: warning: Failed to sign .dsc and .changes file

Now move to the upper directory, where the freshly genereated .deb files reside:

cd ..
ls -1 *.deb


(The actual versions of your compiled packages may differ slightly.)

Then we install patched postfix and postfix-mysql packages:

dpkg -i postfix_2.5.1-2ubuntu1.1_i386.deb
dpkg -i postfix-mysql_2.5.1-2ubuntu1.1_i386.deb

Share this page:

6 Comment(s)

Add comment


From: MarkFoodyBurton at: 2009-01-21 12:17:13

Not sure the quota stuff will work

1. the postfix config param seems to be virtual_mailbox_limit, not virtual_mailbox_limit_map as mentioned here.

2. I suspect  that since Dovecot is being used for delivery, the number will be ignored anyway?

 Hope I'm wrong :-)






From: vivek at: 2011-06-02 10:26:13

In the mysql query from where does the place holder is getting the values. I am new to this world please help

From: Paul H at: 2008-10-28 18:25:36

It appears that dovecot expects a returned field called 'password' whilst the mysql and drupal returns a field called 'pass' which means that authentications via pop3 and imap don't work.

Any thoughts?


From: Nik Sulaiman at: 2008-11-18 03:11:04

in /etc/dovecot/dovecot-sql.conf

add the underlined text:

password_query = SELECT mail AS user, pass AS password FROM users WHERE mail='%u';

I was having the problem too, thanks for the post.

Managed to authenticate via imap successfully. Hope it helps.

From: at: 2009-03-06 21:29:14

Nik Sulaiman,

 Thank you for your fix. It has been updated in the tutorial.

 Alex Saavedra

From: plen at: 2011-01-29 07:57:53

The mail_plugins line in the dovecot.conf should be set to just "sieve" not "cmusieve"