One of the problems I've always run into when installing qmail on
servers (which have almost always been running RedHat, CentOS, or some
other RedHat-derived Linux distribution) is that they all pre-install
sendmail package, and they all have RPM dependencies
which prevent you from un-installing the
My solution to this has always been to leave the
sendmail package installed, but not use it. I renamed
/usr/sbin/sendmail to something else, and then created the
symlink from that name to
detailed in djb's directions. For the most part, this strategy worked
withouth any problems, however sometimes the
package would be updated in the repositories and a "yum upgrade" command
would mess up the symlinks and re-install parts of it.
I remembered reading, a long time ago, about an RPM that somebody had
made which would satisfy the dependencies which kept the
sendmail package from being un-installed, but not actually
touch the system. However, the computer where I saved the link suffered
a hardware failure and I never did get around to searching for it again,
and it was honestly never a big enough issue for me to spend the time to
learn how to create RPM files and do it myself.
Earlier today (2006-04-06), Robert Hanson posted a message on the qmailrocks mailing
list which contained a spec file for building such an RPM. I tried
building and installing an RPM from this on my own server, and then
tried to un-install
sendmail. It didn't work- two other
packages on my sytem (Centos 3.6) had explicit dependencies on the
So, I added this filename to the
Provides: line in the
spec file, rebuilt the RPM, and re-installed it... and then the system
was very happy to allow the
sendmail package to be
fake-smtp.spec is the modified spec
file, which can be used to build an installable RPM file. This has the
Provides: line, as well as a more complete
description of what the "package" does, why somebody might want to
use it, and a link to this web page.
fake-smtp-1.0-1.noarch.rpm is an RPM file built using the spec file above, for those who don't want to deal with building their own RPM files.
2008-07-16 Rick Widmer sent me an RPM file (and its spec file) which do the same thing, but are written for SuSE Linux instead of RedHat and friends. The email message said:
I've attached a fake-smtp-suse spec file and rpm that work just like yours for Red Hat, except SuSE uses smtp_daemon instead of smtpdaemon. You install it the same as the Red Hat one, then uninstall postfix instead of sendmail.
# rpm -ivh fake-smtp-suse-1.0-1.noarch.rpm
# rpm -e postfix
If you create the RPM from the specfile, SuSE places it in the directory /usr/src/packages/RPMS/noarch/
This has been tested with OpenSuSE 10.3, but I expect it to work with any recent version.
The files: fake-smtp-suse.spec and fake-smtp-suse-1.0-1.noarch.rpm, for your downloading pleasure. Thanks, Rick!
A spec file is the heart of an RPM file. It lists the directions needed in order to compile and install the underlying package, as well as a list of the files which are installed by the RPM file.
The spec file above is a very simple one- it has a
Provides: line, whose information is added to the RPM
database on the system when the RPM file is installed, and the sections
which would list how to compile and install the program are totally
empty- which ends up building an RPM which doesn't actually add or
change anything on the system, but it adds a few entries to the RPM
database which convince the system that those "features" are there.
If you downloaded the spec file and you want to build an installable RPM file from it, the process will look like this:
# rpmbuild -ba fake-smtp.spec
Most RedHat systems build new RPM files in the
/usr/src/rpm directory. After running this command you will
find the following files:
is the installable RPM file.
a source RPM. Normally a source RPM would contain the spec file, along
with the source code tarballs, patches, scripts, and other files
necessary to compile and install the package. In this case, the source
RPM contains nothing but a copy of the spec file, because there ARE no
other files needed to build the "binary" RPM.
You must install the newly-created
before the system will let you un-install the
# rpm -ivh fake-smtp-1.0-1.noarch.rpm
Preparing... ########################################### [100%]
1:fake-smtp ########################################### [100%]
# rpm -e sendmail
Saving /etc/aliases as /etc/aliases.rpmsave
If your system creates an /etc/aliases.rpmsave file, you may wish to remove it.
# rm /etc/aliases.rpmsave
There are packages for other operating systems which do the same
thing as this
Debian Linux: Just as RedHat and friends have a dependency
on the name "smtpdaemon", Debian systems have the same kind of
dependency, using the name "mail-transport-agent". The first
http://www.differentpla.net/node/166 explains how to create a dummy
.deb file which satisfies this dependency, just like the
"fake-smtp" RPM file we created above.
Make sure to read the comments that people left- apparently there are some issues with other packages (like Apache?) being un-installed along with exim (which is the default MTA for debian systems.)
The page contains a pointer to run the config-fast.sh script when installing qmail. If you are building a system which will be using vpopmail to manage the mailboxes for all of your domains, you should not run this script- it creates a /var/qmail/control/locals file which contains the domain name you entered. For a system where vpopmail handles everything, the locals file should be zero bytes (but it should exist.)
Others will be added as I find them. If you know of any similar packages for other operating systems (or distributions of Linux), please let me know about them- my email address is listed at the bottom of the page.