Home > Linux, Postfix > Patching Postfix for mySQL and Quotas

Patching Postfix for mySQL and Quotas

April 20th, 2008 Leave a comment Go to comments

If you are hosting email for more than one domain you might want to look into virtual hosting. With virtual hosting most choose to use database vs files to store the mailbox information. Not only does this allow a more flexible configuration, but the ability to use a web interface such as Postfix Admin. Out of the box Fedora Core 8 Postfix RPM does not support mySQL or quota support. However a simple recompile and install of the resulting package will get you up and running.

First we need to download the postfix SRPM

cd ~
wget http://download.fedoraproject.org/pub/fedora/linux/releases/8/Fedora/source/SRPMS/postfix-2.4.5-2.fc8.src.rpm

Next setup the RPM build area


Install the SRPM into the rpmbuild directory

rpm -ivh postfix-2.4.5-2.fc8.src.rpm

Now download the quota patch

cd ~/rpmbuild/SOURCES
wget http://vda.sourceforge.net/VDA/postfix-2.4.5-vda-ng.patch.gz
gunzip postfix-2.4.5-vda-ng.patch.gz

Let’s enable mysql and quota support

cd ~/rpmbuild/SPECS
vim postfix.spec
Line 2:
-%define MYSQL 0
+%define MYSQL 1
Line 82:
Patch10: postfix-2.4.5-open_define.patch
+Patch11: postfix-2.4.5-vda-ng.patch
Line 140:
%patch10 -p1 -b .open_define
+%patch11 -p1 -b .vda-ng

Now we can build the modified RPM and install it

rpmbuild -ba postfix.spec
sudo rpm -ivh ~/rpmbuild/RPMS/`uname -p`/postfix-2.4.5-2.`uname -p`.rpm
Categories: Linux, Postfix Tags: ,
  1. No comments yet.
  1. No trackbacks yet.