On Mon, Mar 31, 2008 at 01:27:32PM +0300, AlxFrag wrote:
I'd like to ask if it is possible to log the last time a user has
logged in using POP or IMAP. I'm aiming to detect users who have not
logged in for a long time and deactivate their accounts.
The logs stored in /var/log/mail are not very helpful as i need an
Option 1: You can parse the log files.
Option 2: You can check the mtime of the Maildir/cur/ directory, since
whenever the user logs in, mail is moved from new/ to cur/
With option 2, the cur/ timestamp normally won't update if the user logs in
but has not received any mail. But you can add a patch to force the
timestamp to be updated even if no new mail has arrived - see attached.