[Dovecot] Last login datetime on accounts
robert at schetterer.org
Mon Jul 16 09:45:32 EEST 2012
Am 16.07.2012 01:31, schrieb Robert Blayzor:
> I have searching for the best way to tell if a Dovecot user is idle by finding the last time they have logged in.
> Right now the best way I can tell is to do something like "touch" a file in the users homedir via a post login exec.
> This seems like a LOT of overhead, to accomplish such a simple task, especially if your doing a lot of dozens of logins per second. Is there an easier/better way? Is there a way to possibly tell Dovecot to refresh the mod time on an index file whenever the user successfully auths or to refresh a separate file in the homedir, ie: ~/.lastlogin (not ~/Maildir/.lastlogin as that would obviously cause some issues)
> Seems like something that would be far less overhead than calling a shell, execing another command, etc.
> I'm open to other ideas/alternatives if they are out there!
i have running touch with 3000 users, i dont see much overhead, anyway
its true ,its not very elegant, perhaps i.e you may write some daily
cron bash find script looking about latest timestamp of files in .new
which of cource is not the same as last_login script, but may good
enough for you
MfG Robert Schetterer
More information about the dovecot