I'm looking for a way to figure out which accounts have not been logged in to in over n days. It occurs to me that, perhaps, the way to do this would be to look at the mtime on one of the dovecot-maintained files, like 'dovecot-uidlist'. Is there a particular file that would be modified on (almost) every login, whether it be via POP or IMAP? -Ben -- Ben Beuchler There is no spoon. insyte at emt-p.org -- The Matrix
On 11.10.2004, at 16:39, Ben Beuchler wrote:> I'm looking for a way to figure out which accounts have not been > logged in > to in over n days. It occurs to me that, perhaps, the way to do this > would be to look at the mtime on one of the dovecot-maintained files, > like > 'dovecot-uidlist'. Is there a particular file that would be modified > on > (almost) every login, whether it be via POP or IMAP?Probably best would be to check atime of .INBOX/.imap.index file. dovecot-uidlist isn't necessarily accessed every time. And if nothing has changed in mailboxes, mtime isn't changed from any file. -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20041011/cc5a562a/attachment-0001.bin>
> I'm looking for a way to figure out which accounts have not been logged > in to in over n days. It occurs to me that, perhaps, the way to do this > would be to look at the mtime on one of the dovecot-maintained files, > like 'dovecot-uidlist'. Is there a particular file that would be > modified on (almost) every login, whether it be via POP or IMAP?The finger command (at least in redhat) looks at teh atime of /var/spool/mail/username You may be able to do somethign similar but it is dependant on using mbox in that dir. Some filesystems may also be mounted to NOT updated the atime of files (Saves "unnecassary" hard disk writes). -- Dean Earley AKA Dee (dean at earlsoft.co.uk) irc: irc://irc.blitzed.org/ web: http://personal.earlsoft.co.uk phone: +44 (0)780 8369596
--On Monday, October 11, 2004 8:19 PM +0300 Timo Sirainen <tss at iki.fi> wrote:> Probably best would be to check atime of .INBOX/.imap.index file. > dovecot-uidlist isn't necessarily accessed every time. And if nothing has > changed in mailboxes, mtime isn't changed from any file.But watch out when you do backups. I'm using dump, which doesn't affect atime, but I do use "restore -C" to verify the tape and that does touch atime. So I temporarily turn off atime on the filesystem while doing the verify. Example from my verify script: /bin/mount -o remount,noatime /boot $RESTORE -C -l -L $MAXMISCOMPARES -b $BLOCKING -f $DUMPSUBDIR/boot.dump /bin/mount -o remount,atime /boot This disables atime updates on the boot partition, verifies the backup for that partition, and then turns the updates back on. This is precisely so that I can use atime to monitor for dead mailboxes.
On Mon, Oct 11, 2004 at 08:19:37PM +0300, Timo Sirainen wrote:> On 11.10.2004, at 16:39, Ben Beuchler wrote: > > >I'm looking for a way to figure out which accounts have not been logged > >in to in over n days. It occurs to me that, perhaps, the way to do > >this would be to look at the mtime on one of the dovecot-maintained > >files, like 'dovecot-uidlist'. Is there a particular file that would > >be modified on (almost) every login, whether it be via POP or IMAP? > > Probably best would be to check atime of .INBOX/.imap.index file. > dovecot-uidlist isn't necessarily accessed every time. And if nothing > has changed in mailboxes, mtime isn't changed from any file.Unfortunately, I've mounted the filesystem with 'noatime'. However, since I'm only interested in people that haven't logged in in a very long time, mtime of .INBOX/.imap.index would probably suffice. Thanks! -- Ben Beuchler There is no spoon. insyte at emt-p.org -- The Matrix