Ubuntu Qmail HOWTO
Ubuntu used to have the qmail-src package available in the multiverse collection, however due to the lack of attention by whomever monitors the build reports, breezy doesn’t have the package availble to it. However, since the debian package is an all-platform package, one can simply use it to get where you need to go. The process is easy (once you’ve figured it the hell out).
- download the Debian stable .debs for qmail-src and ucspi-tcp to your ubuntu system
- use dpkg to install them manually
- run build-ucspi-tcp
- run build-qmail
- (optional) apply patches
First, you need to fetch the .debs for qmail-src and ucspi-tcp-src from the debian-stable distribution. Use the architecture all link at the bottom to find and download the .deb from any mirror. Save each file on the target system.
wget (...) ucspi-tcp/ucspi-tcp-src_0.88-9_all.debwget (...) qmail/qmail-src_1.03-38_all.deb
Next, use the dpkg command to install them. I used the following commands:
sudo dpkg -i ./ucspi-tcp-src_0.88-9_all.debsudo dpkg -i ./qmail-src_1.03-38_all.deb
Now, build ucspi, letting it be installed. I usually purge the installer package as it’s not needed anymore:
build-ucspi-tcp
Then, build the qmail package:
build-qmail
When I build, I install this patch I made which is a version of the qmail-spp patch modified to work against the debian patched source tree. To apply it, all you need to do is download it and run the following:
cd /tmp/qmail/qmail-1.03patch -p 1 ~/debian-qmail-src-to-qmail-spp.patch
That’s it!

April 5th, 2006 at 02:42
Life has been so much better since I left qmail and converted completely to Postfix. Thanks for reminding me of the little annoyances I’m still missing.
April 13th, 2006 at 07:00
I’m still using Qmail and your patch patch’d fine with the qmail-src package, but I’m noticing that it’s not passing the recpt to my script. I have a vpopmail-check-recipient.sh script and from the command prompt, it works fine, but through the qmail-spp patch, it’s not finding virtual aliases within vpopmail for some reason. Any ideas?
April 13th, 2006 at 09:20
Figured it out. Vpopmail permission problem.
April 13th, 2006 at 09:34
I’m glad you worked it out! Debugging mail queues can be time consuming, frustrating work. One thing the patch above doesn’t handle is the fact that you need to create an
smtppluginsconfiguration file before any mail receipt will function. The smtp daemon bombs out with a generic ‘unable to read controls’ error otherwise. Took me a while and a round withstraceto figure that one out. Had I not stopped early to see if things were working properly, it never would have tripped me up.June 18th, 2006 at 14:35
Hello,
If you want qmail+smtp_auth+vpopmail-mysql+qmailadmin+autorespond you could try my debian sarge packages. URL: http://debian.iuculano.it/
June 18th, 2006 at 20:07
Have you verified that these packages work on ubuntu without rebuilding? Capricous mixing debian and ubuntu repositories can have undesirable consequences, so be careful.
I would suggest adding the deb-src repository lines and then building ubuntu packages on your system before I would use the .deb directly.
June 20th, 2006 at 15:42
Sorry, yes, you should rebuild package for ubuntu! Soon I rebuild it for dapper
July 28th, 2006 at 06:38
My question is, how do you apply the patch? I assume before I start build-qmail, right? But I have no src folder, I only have the qmail-src tarballs, so should I unpack the tarballs, apply the patch and repackage it, and then run build-qmail?
Greets
eitch
July 30th, 2006 at 03:45
Eitch,
When you run the build-qmail script, it stops right before the compilation and prompts you to apply any patches in the build tree it has created in /tmp. You have to use another terminal to do it, then return and hit enter to continue with the .deb construction.
CLD
August 10th, 2006 at 19:42
I tried building qmail and everything went fine but I don’t see anywhere to apply patches and the install doesn’t prompt me at all, any ideas?
August 10th, 2006 at 22:45
Uniacid,
As mentioned in the comment immediately above yours, there’s a stage in the build process which tells you to open another terminal and apply any desired patches.
CLD
November 22nd, 2006 at 17:20
[...] Ubuntu Qmail HOWTO (tags: linux ubuntu sysadmin email qmail) [...]
November 29th, 2006 at 17:48
I’ve installed qmail several times on different systems. However, I have one problem on Ubuntu that seems simple, yet stumps me. There seems to be no /etc/inittab file in which to put the entry for svscanboot. So, where should I put the kicker for svscanboot? In /etc/rc.local?
Thanks.
– Jeremy
November 29th, 2006 at 23:39
That’s not right. You must be missing something because without an /etc/inittab file your system will not successfully boot. I would check again.
Also, if you are using the packages above, then you don’t launch qmail with svscan in inititab, it is run as a daemon from /etc/init.d as other processes are.
March 2nd, 2007 at 14:17
Trying to install qmail on ubuntu edgy.
dpkg: error processing qmail_1.03-38_i386.deb (–install):
subprocess pre-installation script returned error exit status 2
Errors were encountered while processing:
qmail_1.03-38_i386.deb
Do you want to purge qmail-src now? [yN] y
(Reading database … 109489 files and directories currently installed.)
Removing qmail-src …
Purging configuration files for qmail-src …
Remember that you can install qmail_1.03-38_i386.deb
on other computers so you don’t need to compile it again.
Don’t forget to setup a /etc/qmail/rcpthosts file to prevent open relaying!
Good luck!
March 2nd, 2007 at 14:26
qmail-pop3d.c:48: warning: conflicting types for built-in function ‘puts’
qmail-pop3d.c: In function ‘main’:
qmail-pop3d.c:297: warning: return type of ‘main’ is not ‘int’
March 13th, 2008 at 03:40
I have the same issue with qmail on hardy/
dpkg –force-all -i /tmp/qmail/qmail_1.03-44_amd64.deb
(Reading database … 93196 files and directories currently installed.)
Unpacking qmail (from …/qmail/qmail_1.03-44_amd64.deb) …
Performing install
First installation of the Debian qmail package…
Checking if qmail is already installed on this computer… no.
Checking group qmail (gid 64010)… ok.
Checking user alias (uid 64010, gid 65534, homedir /var/qmail/alias)… ok.
Checking user qmaild (uid 64011, gid 65534, homedir /var/qmail)… ok.
Checking user qmails (uid 64012, gid 64010, homedir /var/qmail)… ok.
Checking user qmailr (uid 64013, gid 64010, homedir /var/qmail)… ok.
Checking user qmailq (uid 64014, gid 64010, homedir /var/qmail)… ok.
Checking user qmaill (uid 64015, gid 65534, homedir /var/qmail)… ok.
Checking user qmailp (uid 64016, gid 65534, homedir /var/qmail)… ok.
Could not open /etc/inetd.conf
dpkg: error processing /tmp/qmail/qmail_1.03-44_amd64.deb (–install):
subprocess pre-installation script returned error exit status 2
Errors were encountered while processing:
/tmp/qmail/qmail_1.03-44_amd64.deb
March 15th, 2008 at 20:09
Well, forcing all isn’t necessary to install the package. You’re probably missing the inetd package which is a prerequisite for qmail. Consider not forcing anything.
April 13th, 2008 at 22:33
[...] With the moving of ubuntu from the old fashioned init to the modern upstart, the daemontools package doesn’t cleanly install. Here’s how to fix it. You really do need daemontools if you’re going to run djbdns or qmail. [...]