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.
- Got the MySQL rpms from http://www.mysql.com/. (Including client, server
and devel packages).
- 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.
- Copied the tgz's to / and ran /usr/lib/setup/pkgtool to install all
three of them.
- Read the docs on MySQL and got the server running.
- (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/ld.so.conf
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".)
- 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));
quit;
- Downloaded the qpopper/mysql patch from http://hades.riverstyx.net/qpopmysql/.
- Downloaded qpopper3.0 from ftp://ftp.qualcomm.com/
- Un-tar-gzed the qpopper package, went into the qpopper directory
and did ./configure.
- Edited mspatch as follows (I had to or it wouldn't patch.):
[orig]
*** - Sun Jul 17 16:46:18 1994
--- popper_conf.c Thu Jan 14 21:13:14 1999
[edited]
*** ../../qpopper3.0/popper/popper_conf.c Sun Jul 17 16:46:18 1994
--- popper_conf.c Thu Jan 14 21:13:14 1999
- Copied mspatch into qpopper3.0/popper and ran patch -p1 < mspatch.
(That's a "one" not an "ell.")
- 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. :)
- Copied the Makefile that came with the mspatch to qpopper3.0/popper.
- 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. :-)
- Went back into qpopper3.0 directory and ran "make".
- 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
- Ran a "kill -HUP" on inetd so it would re-read the inetd.conf file.
- 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. :-)
- Added a user to the mysql popUsers table.
- 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. :-)