Setting up Tani Hosokawa's MySQL/Qpopper patch

First of all, I started out with Slackware with Linux kernel 2.2.3 on an intel box. Here's what I did to get it to compile, more or less.

  1. Got the MySQL rpms from (Including client, server and devel packages).
  2. Used rpm2targz to convert the rpms to tar.gz files. Then, renamed them to file.tgz so that I could use pkgtool to install them.
  3. Copied the tgz's to / and ran /usr/lib/setup/pkgtool to install all three of them.
  4. Read the docs on MySQL and got the server running.
  5. (Alternate: got the source package for MySQL on SuSe 6.1, and compiled from scratch. Then, added the line "/usr/local/lib/mysql" to /etc/ and ran "ldconfig" to add the library path to the MySQL libraries. If you can't find the MySQL libraries while compiling, try this, or try "export LD_LIBRARY_PATH=/usr/local/lib/mysql".)
  6. Ran mysql -p to log into the MySQL server. Ran:
    create database qpopper;
    use qpopper;
    create table popUsers (username char(32), password char(32), uid mediumint(9), gid mediumint(9), maildrop char(128));

  7. Downloaded the qpopper/mysql patch from
  8. Downloaded qpopper3.0 from
  9. Un-tar-gzed the qpopper package, went into the qpopper directory and did ./configure.
  10. Edited mspatch as follows (I had to or it wouldn't patch.):
    *** -       Sun Jul 17 16:46:18 1994
    --- popper_conf.c       Thu Jan 14 21:13:14 1999
    *** ../../qpopper3.0/popper/popper_conf.c       Sun Jul 17 16:46:18 1994
    --- popper_conf.c       Thu Jan 14 21:13:14 1999
  11. Copied mspatch into qpopper3.0/popper and ran patch -p1 < mspatch. (That's a "one" not an "ell.")
  12. Edited the Makefile that came with the mspatch to change the -l[mysql library] to point to -l/usr/lib/mysql instead of -l/usr/local/mysql/lib/mysql. Also, you should probably change this to wherever your install of MySQL put your libraries. :)
  13. Copied the Makefile that came with the mspatch to qpopper3.0/popper.
  14. In qpopper3.0/popper/pop_init.c, commented out the case 'e': block because the sucker would not compile with it in, and I didn't feel like trying to fix it. :-)
  15. Went back into qpopper3.0 directory and ran "make".
  16. I basically just left everything where it was, and added the following to /etc/inetd.conf:
    pop3   stream  tcp     nowait  root    /usr/src/qpopper3.0/popper/popper popper -s
  17. Ran a "kill -HUP" on inetd so it would re-read the inetd.conf file.
  18. Created a file /etc/popper.conf with the following entries:
    MySQLUsername qpopper
    MySQLPassword password
    MySQLAuthDB qpopper
    MySQLAuthTable popUsers
    MySQLAuthUsernameField username
    MySQLAuthPasswordField password
    MySQLAuthPasswordMethod crypt
    MySQLAuthSpoolField maildrop
    (With different username and password, of course. :-)
  19. Added a user to the mysql popUsers table.
  20. Telnetted to port 110 of the host with the new qpopper, and ran:
    user username
    pass password
    and it worked!
Your mileage may vary -- I haven't tested whether it can actually get mail from the appropriate maildrop yet. :-)