10 - Disabling Sendmail/Exim
Well, the moment you've been waiting for is finally here. We're going to disable sendmail/exim from the server. On many *nix flavors, sendmail is a the typical MTA installed by default. However, an out of the box Debian install will typically have exim installed instead. sendmail is a very commonly used command on most *nix servers, so Debian compensates for this by having symbolic sendmail links that point to exim. For example, on a Debian box /usr/sbin/sendmail is merely a symbolic link pointing to exim. Interestingly enough, qmail works the same way. So all we are going to do is (1) disable exim and then (2) create new sendmail symbolic links that point to qmail instead of exim. Additionally, Postfix (another MTA) is often installed on many out of the box Debian installs, so we'll make sure Postfix is uninstalled as well.
So, let's start off by disabling exim. In case you're curious, we're going to disable exim as opposed to uninstalling it because uninstalling exim causes all sorts of packages the freak out. So it's best to keep in on the system, and just disable it.
First, we'll stop exim...
Now, we will prevent exim from starting up on boot. We do this by modifying the runlevel scripts for each runlevel. I'm only going to disable exim for runlevel 2, since most out of the box Debian installed default to a runlevel of 2.
mv S20exim K20exim
Now let's remove any old sendmail symbolic links...
rm -f /usr/lib/sendmail
rm -f /usr/sbin/sendmail
Now we will need to set up an "artificial" sendmail, which is just a symbolic link to qmail's "sendmail". Qmail is equipped with it's own "sendmail" binary at /var/qmail/bin/sendmail, which is merely a direct inject into qmail.
ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
That's it! If all has gone well, sendmail should be uninstalled and the qmail sendmail should be in its place. A listing of the 2 sendmail symbolic links should look like this:
lrwxrwxrwx 1 root root 23 Dec 19 15:27 /usr/sbin/sendmail -> /var/qmail/bin/sendmail
lrwxrwxrwx 1 root root 23 Dec 19 15:27 /usr/lib/sendmail -> /var/qmail/bin/sendmail
If you're listing of the sendmail symbolic links does NOT show them pointing to qmail's sendmail binary, you've screwed up. Go back and make sure you get it right.
Finally, we will uninstall Postfix, if it happens to be installed. I know that on my out of the box Debian sever, Postfix was installed. So, if you're in the same boat, pay attention. If you are certain that Postfix is not installed on your server, you can save yourself about 3 seconds and skip this next command.
dpkg --purge --force-depends postfix
The above command will uninstall Postfix, if it's installed. If it's not installed, you will get a message telling you so. Hey, that was easy.
If you've got it all right, it's now time to give qmail a final test and then crank it up!
This mirror last modified: Thursday, August 9th, 2012 15:58:48 CEST