How to log vpopmail user qmail-pop3d logins

EQ Admin

EQ Forum Admin
Staff member
Hello,

To log pop3 logins to your current qmail-pop3d log file without making any qmail source changes please follow these directions :


Create a shell script :

> vi /export/vpopmail/bin/qmail-pop3d-wrapper.sh

#!/bin/sh
echo "qmail-pop3d: $VPOPUSER logged in from $TCPREMOTEIP" >&5
$@

Make it executable:

> chmod 755 /export/vpopmail/bin/qmail-pop3d-wrapper.sh


Update the end of your qmail-pop3d run file :

> vi /var/qmail/supervise/qmail-pop3d/run

/export/vpopmail/bin/vchkpw /export/vpopmail/bin/qmail-pop3d-wrapper.sh /export/qmail/bin/qmail-pop3d Maildir 2>&1 5>&1

The two sections in blue are the additions needed near the end of the file.


Stop and start your qmail-pop3d :

> svc -d /service/qmail-pop3d
> svc -u /service/qmail-pop3d


Check your current qmail-pop3d log file for the additional information :

> tail -f /export/qmail-log/pop3d/current


If everything is working you will have lines that look like :

qmail-pop3d: vpopuser@example.com logged in from 10.21.32.45


Please note that I use /export for some file systems where a standard qmail install would be located within /var/qmail.

It is ok to change the paths and locate the wrapper script to the most appropriate location on your servers.

If you would prefer to directly patch your qmail install (untested) it appears there are patches available here.

If you are not running vpopmail you can use $USER instead of $VPOPUSER in the wrapper shell script above.
 
Top