checkpw-pop3

What is it?

checkpw-pop3 is a checkpassword compatible program that authenticates against a POP3 server.

It is useful when one needs to use SMTP AUTH with an SMTP server that cannot directly access the POP3 server or user account database.

This software is public domain.

How to install checkpw-pop3

Download the checkpw-pop3 package. The latest published checkpw-pop3 package is checkpw-pop3-0.51.tar.gz.

Unpack the checkpw-pop3 package:

gunzip checkpw-pop3-0.51.tar
tar -xf checkpw-pop3-0.51.tar
cd checkpw-pop3-0.51

Compile the checkpw-pop3 program:

make

As root, install /usr/local/bin/checkpw-pop3:

make install

The checkpw-pop3 program

checkpw-pop3 prog

Environment variables

There are two optional environment variables that tell checkpw-pop3 the location of the POP3 server to authenticate against:

$HOST is the hostname of the POP3 server. If not specified, it defaults to localhost.

$PORT is the port number of the POP3 server. If not specified, it defaults to 110.

Testing

The following tests assume that you have already installed qmail.

You can test checkpw-pop3 without having a POP3 server. In the following example, checkpw-pop3 will connect to localhost on port 2000. Successful authentication will cause the current working directory to be printed:

$ /var/qmail/bin/qmail-popup foo env HOST=localhost PORT=2000 checkpw-pop3 pwd
+OK <...@foo>
USER bar
+OK
PASS blah
-ERR authorization failed

The following will simulate a POP3 server on port 2000 that successfully authenticates everything. To cause it to unsuccessfully authenticate everything, change the "+OK" to "-ERR":

tcpserver localhost 2000 /var/qmail/bin/qmail-popup foo echo "+OK"

Of course, the best way to test it is to try authenticating against a real POP3 server with a valid (or invalid) username and password.

Process-state changes

Unlike checkpassword, checkpw-pop3 does not make any process state changes before invoking prog.

Real life usage

checkpw-pop3 has been tested with Eric M. Johnston's YAQSAP (Yet Another qmail SMTP AUTH Patch). Change the invocation of qmail-smtpd to use checkpw-pop3, as indicated by the patched man page qmail-smtpd(8):

qmail-smtpd hostname /usr/local/bin/checkpw-pop3 /bin/true

The environment variables controlling checkpw-pop3 must be set before qmail-smtpd is run.


David Phillips david.acz.org Valid HTML 4.01!