Home / Article / Installing maildrop on CentOS 5

Installing maildrop on CentOS 5

I have been in the process of migrating my websites from a couple of dedicated machines to a VPS (Virtual Private Server) which has a fairly minimal base install of CentOS 5 on it. My existing mailserver runs on Gentoo Linux, running Postfix, courier-imap, maildrop, Spamassassin and ClamAV, with the mail accounts and aliases handled by MySQL.

I would have liked to have run only packages available from the CentOS distribution (plus the addons etc) but neither courier-imap nor maildrop are available in the CentOS package trees. Instead I would need to use either cyrus-imapd or dovecot and maildrop was not available at all.

After spending several hours looking at the possible setups, I couldn’t seem to find anyone who had done more or less exactly what I wanted to do on a CentOS server; ie mail filtering through anti-spam and anti-virus software, and then further filtering into specific imap directories. The SMTP and POP/IMAP servers seem to work fine with MySQL, and I found plenty of howtos to integrate them with anti-spam and anti-virus software (although on other distros, and with amavisd which is not available in the CentOS packages), so I was drawing a bit of a blank.

So finally, I have decided to go ahead and install maildrop myself using the source files, which contain the necessary stuff to build an RPM and then install it. I will write up another post later once I have the full mail server installed but this will do for now, to cover installing maildrop on CentOS 5.

First of all, you need to download the latest version of maildrop from Sourceforge. The version I used was 2.0.4 as you will see in the examples below. Note that using $EDITOR will use whatever your environment has defined as your text editor; it’s possible it may not be defined. You can substitute it for your favourite editor, such as nano or vi.

cd ~/temp
mkdir rpmbuild
mkdir rpmbuild/BUILD rpmbuild/RPMS rpmbuild/SOURCES rpmbuild/SPECS rpmbuild/SRPMS
mkdir rpmbuild/RPMS/i386 rpmbuild/RPMS/i586 rpmbuild/RPMS/i686
mkdir rpmbuild/SRPMS/i386 rpmbuild/SRPMS/i586 rpmbuild/SRPMS/i686
$EDITOR ~/.rpmmacros
At this stage you need to enter the text below into your editor and then save. (I’m not sure if this is required or not, but it was in the instructions I was following).

%_topdir        %(echo $HOME)/temp/rpmbuild
%debug_package  %{nil}

Now we continue…

cd rpmbuild/SOURCES
wget http://switch.dl.sourceforge.net/sourceforge/courier/maildrop-2.0.4.tar.bz2
rpmbuild -ta maildrop-2.0.4.tar.bz2
At this stage I got some dependency error messages. You may get different ones, or none at all. It will simply be a case of installing the missing dependencies.

error: Failed build dependencies:
/usr/include/fam.h is needed by maildrop-2.0.4-1.i386
gdbm-devel is needed by maildrop-2.0.4-1.i386
pcre-devel is needed by maildrop-2.0.4-1.i386
In my case I needed to install gamin-devel (which provides fam.h), gdbm-devel and pcre-devel like so:

sudo yum install gamin-devel gdbm-devel pcre-devel
So we try again:

rpmbuild -ta maildrop-2.0.4.tar.bz2
It takes a little while to build the RPM files, but once they are created they are located in ~/temp/rpmbuild/RPMS/i386. A quick directory listing will show something along the lines of this:

-rw-rw-r-- 1 chris chris 312609 Oct 18 23:47 maildrop-2.0.4-1.i386.rpm
-rw-rw-r-- 1 chris chris 208302 Oct 18 23:47 maildrop-devel-2.0.4-1.i386.rpm
-rw-rw-r-- 1 chris chris  58242 Oct 18 23:47 maildrop-man-2.0.4-1.i386.rpm

So now it’s just a matter of changing to ~/temp/rpmbuild/RPMS/i386 and installing the files like shown below. I didn’t bother to install the development RPM as there didn’t seem much point. I can always install it later if required.

sudo rpm -ivh maildrop-2.0.4-1.i386.rpm maildrop-man-2.0.4-1.i386.rpm
Now that the RPM is installed, the following files have been installed:



I’ll cover actually using and configuring maildrop in a later article and will provide links here to it when completed.