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).

  1. download the Debian stable .debs for qmail-src and ucspi-tcp to your ubuntu system
  2. use dpkg to install them manually
  3. run build-ucspi-tcp
  4. run build-qmail
  5. (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.deb
  • wget (...) 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.deb
  • sudo 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.03
  • patch -p 1 ~/debian-qmail-src-to-qmail-spp.patch

That’s it!

19 Responses to “Ubuntu Qmail HOWTO”

  1. Eric Hammond Says:

    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.

  2. Jon Bibeau Says:

    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?

  3. Jon Bibeau Says:

    Figured it out. Vpopmail permission problem.

  4. caskey Says:

    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 smtpplugins configuration 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 with strace to figure that one out. Had I not stopped early to see if things were working properly, it never would have tripped me up.

  5. Giuseppe Says:

    Hello,

    If you want qmail+smtp_auth+vpopmail-mysql+qmailadmin+autorespond you could try my debian sarge packages. URL: http://debian.iuculano.it/

  6. caskey Says:

    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.

  7. Giuseppe Says:

    Sorry, yes, you should rebuild package for ubuntu! Soon I rebuild it for dapper

  8. eitch Says:

    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

  9. caskey Says:

    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

  10. uniacid Says:

    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?

  11. caskey Says:

    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

  12. links for 2006-11-23 « Bloggitation Says:

    […] Ubuntu Qmail HOWTO (tags: linux ubuntu sysadmin email qmail) […]

  13. Jeremy Says:

    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

  14. caskey Says:

    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.

  15. EMRUFUS Says:

    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!

  16. EMRUFUS Says:

    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’

  17. mariuz Says:

    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

  18. caskey Says:

    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.

  19. Paralipsis » Blog Archive » Configuring Daemontools under Ubuntu (upstart) Says:

    […] 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. […]

Leave a Reply