How to log vpopmail user qmail-pop3d logins

Discussion in 'qmail' started by popowich, Apr 28, 2012.

  1. popowich

    popowich EQ Forum Admin Staff Member

    Aug 12, 2008
    Likes Received:

    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/

    echo "qmail-pop3d: $VPOPUSER logged in from $TCPREMOTEIP" >&5

    Make it executable:

    > chmod 755 /export/vpopmail/bin/

    Update the end of your qmail-pop3d run file :

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

    /export/vpopmail/bin/vchkpw /export/vpopmail/bin/ /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: logged in from

    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.

Want to reply or ask your own question?

It only takes a minute to sign up (and it's free!). Click the orange sign up button to choose a username and then you can ask your own questions on the forum.