Tuomo Soini currently provides RPMS for Cyrus-SASL and for Postfix. He constructed the RPMS so that they fit together well, which means that when you install both of his RPMS you will be half the way through on your way to a nicely working version of Cyrus-SASL and Postfix.
Tuomos RPMS are SOURCE RPMS. This means that they have to be compiled before we can install them. But before we do this, we'll have to download them.
New to RPM?
Source RPMS (or SRPMS) do not contain the ready-to-run binaries, but merely the source code that still needs to be compiled. So we will compile the SRPMS first and install the RPM that we built after wards. If you want to know more about RPM read this RPM HOWTO.
Point you Browser to http://tis.foobar.fi/software/ and download the current version of the Postfix SRPM to your future SMTP server.
By the time of writing this HOWTO current versions of Cyrus-SASL and Postfix are:
We'll be using these throughout this HOWTO.
First we have to install the SRPMS into the RPM framework. Before you do that, please read this tiny Building RPMS from SRPMS and consider to follow the concept.
Login and cd to the directory where you put the SRPM and install it with:
[firstname.lastname@example.org]# rpm -ivh postfix-1.1.7-t4.src.rpm
Now the SRPM is installed. Our next step is to configure and build it.
First we change to the SPECS directory of our RPM framework:
[email@example.com]# cd rpm/SPECS/
Remember, that Postfix needs the SASL libraries at compilation time. If you don't have Cyrus-SASL installed yet, your Postfix build will fail. To get a working SASL either install from Cyrus-SASL SRPM or from Cyrus-SASL SOURCE.
Tuomos' Version of Postfix comes with support for many additional features. You can trigger enabling or disabling them when you build the RPM. All you need to do is add --with FEATURE or --without FEATURE to the command line. We want SASL and TLS for this HOWTO and will not add anything else. If you want more features you either add them to the following statement or rebuild and reinstall Postfix later once you have SMTP AUTH up and running. So let's find out what is in the SRPM to help you decide.
In order to get to know the features that come with the SRPM you use the following command:
[firstname.lastname@example.org]# rpm -qpil postfix-1.1.7-t4.src.rpm
We build the RPM as follows:
[email@example.com]# rpmbuild -ba --without ldap --without pgsql --without mysql postfix.spec
In case that the RPM Manager complains about missing dependencies you decide on your own if you need to install them first or just tell the RPM Manager to build --without. If everything runs through we've successfully configured and built our customized Postfix RPM.
RedHat Linux comes with Sendmail preinstalled. Since we want to use Postfix instead, we first will have to remove the Sendmail RPM. If we only issue rpm -e sendmail the RedHat Package Manager will complain that there are many other applications that need Sendmails functionality.
Right, but we want Postfix to take over and Postfix will provide binaries that will mend what we will break. So we override the RedHat Package Manager's complaints and advise it, not to check for dependencies when ordered to erase existing Sendmail RPM. Since not every user is allowed to install and uninstall software we su to root first.
[firstname.lastname@example.org]# rpm -e --nodeps sendmail
So Sendmail has just left the building. In comes Postfix...
To install the Postfix RPM we go back to the directory where our newly built RPMS have been put by the RedHat Package Manager:
[email@example.com]# cd ~rpm_user/rpm/RPMS [firstname.lastname@example.org]# rpm -ivh postfix-1.1.7-t4.i386.rpm postfix-utils-1.1.7-t4.i386.rpm
The postfix-utils-1.1.7-t4.i386.rpm installs a few utilities e.g. a Perl script that summarizes the daily mail traffic and prints out a lot of other useful information. It will be called by a cron-job and the output will be mailed to postmaster@localhost.
That's it for the installation. If everything went fine you've successfully installed Postfix from RPM. Before you go and get some fresh coffee, let's wrap things up to now up.
Tuomos Postfix RPM did the following when you installed it:
install Postfix binaries and helper applications
install the configuration files to /etc/postfix/
install the samples and LICENSE to /etc/postfix/samples/
install documentation (man, HTML)
add a smtpd.conf file to /usr/lib/sasl
This file tells SASL how we want to authenticate smtpd queries for authentication. By default it is set to pwcheck_method:saslauthd, which means that it we want to use the saslauthd daemon. If you want to use sasldb stick with this HOWTO. We will enquire this as we get to know our way around configuring Cyrus-SASL
install /etc/cron.daily/postfix.cron a cron file that is run on a daily basis. It rebuilds your .db files and copies changed files to the chroot-dir even if you don't have that configuration enabled.
additionally if you installed: postfix-utils-1.1.7-t4.i386.rpm
install /usr/sbin/pflogsumm.pl a Perl script that will mail you daily stats, if you add this script 1postfix to /etc/cron.daily and chmod 755 1postfix and chown root:root 1postfix the file.
OK. Now take a break. The upcoming configuration will need your full attention again... ;-)