atom feed3 messages in net.sourceforge.lists.courier-imapRe: [Courier-imap] How to log the las...
FromSent OnAttachments
AlxFragMar 31, 2008 3:27 am 
Brian CandlerMar 31, 2008 10:49 pm.Other, .Other
AlxFragMar 31, 2008 11:42 pm 
Subject:Re: [Courier-imap] How to log the last time a a user has logged in
From:AlxFrag (alxf@gmail.com)
Date:Mar 31, 2008 11:42:24 pm
List:net.sourceforge.lists.courier-imap

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,

Thank you. I'll try it.