Skip to content

qpsmtpd-forkserver on debian

I had some problems getting qpsmtpd-forkserver to run on debian. The punchline: qpsmtpd-forkserver relies on an environment variable called QPSMTPD_CONFIG, which should point to the directory containing your config files.

$ export QPSMTPD_CONFIG=/etc/qpsmtp
$ qpsmtpd-forkserver ...

Problem solved.

I didn’t want to run qpsmtpd for its standard usage (wrapping a mail server on the same machine), I just wanted a mail proxy that ran some code whenever any email came in, and then forward the email to a real mail server running on a different machine. qpsmtpd has a great plugin system, and was the path of least resistance. However, Debian’s qpsmtpd package is setup to wrap another mail server running on the same machine, and its init scripts configure the QPSMTPD_CONFIG variable for you. This did not help when I tried to start qpsmtpd-forkserver on the command line. I eventually figured it out by reading through the perl code for qpsmtpd, and then the init script itself.

To add insult to injury, qpsmtpd-forkserver had no way to pass the config on the command line.

I don’t know if this behavior is debian-specific, or just an oversight by the qpsmtpd maintainers.

At any rate, I was able to look through the code and figure it out, which is more than I can say for my latest .NET problem. The solution to that one was to speed my move to a new machine.