How Do i get last lgin date for all my users

Charles Bradshaw brad at bradcan.homelinux.com
Sat Apr 13 10:35:34 EDT 2013


Humm.. definitely it's a hack, but hay it works. Slow because every line
of the log must be examined and there could be many thousands. Why would
anybody care if it's slow?

It's only unreliable in the context of different log formats, so modify
it to your requirements. ;-)

It doesn't necessarily follow that the server 'knows', it's possible
that it's just your mail client keeping track.

On Sat, 2013-04-13 at 09:26 -0400, Adam Tauno Williams wrote:
> On Sat, 2013-04-13 at 12:56 +0100, Charles Bradshaw wrote: 
> > Attached is a little perl script which parses /var/log/maillog and lists
> > the last time users logged in.
> 
> This seems very unreliable, slow, and hacky.  When I login to my e-mail
> the system typically tells me the last time I logged in [at least to
> that app].  Doesn't the meta-data in the IMAP server 'know' this
> information?
> 
> The underlying authentication system [PAM via lastlog, etc...] might
> also have this information.  If your authentication system is LDAP then
> the DSA might know this as well.
> 
> > > > Assuming Linux?UNIX,
> > > > log onto the machine, run the command: last
> > > > This does only work, if IMAP users are system users - which most of
> > > > the time is not the case.
> 
> Yep.
> 
> ----
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus




More information about the Info-cyrus mailing list