Le 3/3/21 à 12:57 PM, @lbutlr a écrit :
I've noticed several threads over the last year or so about last-login, and I 
was curious WHY people care about tracking this in the database. I can see 
wanting to know if a user has logged in recently, but this seems quite easy to 
tell by simply looking at the time stamp and/or contents of the mail spool for 
the user.

For example, on my system I can look at the timestamps on the 'new' folders in 
the user's maildir to see if they are getting mail, and if the folders are 
empty, I have a time stamp of when they last checked that mailbox, giving me a 
pretty accurate time for when they last logged in.

For example, looking at one user:

  # ls -lsdtr /path/to/user/maildir/{new,.**/new}

I can see that the most recent "new" mailboxes were accessed on 02 Mar 14:25 
and 03 Mar 01:45, and I can see that the latter mailbox has files in it and the former 
mailbox does not (just by the size, without doing an extra ls of those directories), so I 
know that the last time the user logged in was about 14:25 or later yesterday and that 
they definitely have not logged in in the last 3h05, which seems close enough to me.

Am I missing some reason I would need/want to keep track of that specific login 
time separately?

What about mbox files ?

-- Yassine.

Reply via email to