Brian Candler wrote:
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 automated process.

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.

Regards,

Brian.
Thank you. I'll try it.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to