[Dovecot] Last login
Hi,
I'm trying to find a way to find inactive users.
Is there a simple way to deduct the last login date of a user from that users Maildir files? Are the timestamps on the index files reliable?
I ask because the system and dovecot logs are not available to me but I can search the whole .../vmail/domain/user/Maildir tree.
I'n running 1.2.9 on ububtu 10.04 LTS with posttfix and postfixadmin. The users (all are virtual) reside in the postfixadmin MySQL tables.
TNX Egbert Jan (NL)
On Sun, Jan 09, 2011 at 09:19:39PM +0100, Egbert Jan van den Bussche wrote:
I'm trying to find a way to find inactive users.
What we do is to touch a file upon every login:
protocol imap { <snip> mail_executable = /usr/local/dovecot/sbin/imap-wrapper.sh }
protocol pop3 { <snip> mail_executable = /usr/local/dovecot/sbin/pop-wrapper.sh }
and these simply do:
#! /bin/sh -
touch /var/log/activemailaccounts/imap/$USER
exec /usr/local/dovecot/libexec/dovecot/imap
Once a day we push this info to a database, and use that to view stats on account/protocol usage.
-jf
Op 9-1-2011 23:55, Jan-Frode Myklebust schreef:
On Sun, Jan 09, 2011 at 09:19:39PM +0100, Egbert Jan van den Bussche wrote:
I'm trying to find a way to find inactive users.
What we do is to touch a file upon every login:
protocol imap { <snip> mail_executable = /usr/local/dovecot/sbin/imap-wrapper.sh }
protocol pop3 { <snip> mail_executable = /usr/local/dovecot/sbin/pop-wrapper.sh }
and these simply do:
#! /bin/sh - touch /var/log/activemailaccounts/imap/$USER exec /usr/local/dovecot/libexec/dovecot/imap
Once a day we push this info to a database, and use that to view stats on account/protocol usage.
-jf TNX!
This works fine! I had to change the path but that is Ubuntu versus your distro. One question though: I have file called "dump-capability" in the ...activeaccounts/imap dir. Any idea what that is? Maybe generated during restart of dovecot? Must be created bij the imap-wrapper.sh.
Egbert Jan
On Mon, Jan 10, 2011 at 04:57:19PM +0100, Egbert Jan van den Bussche wrote:
This works fine! I had to change the path but that is Ubuntu versus your distro. One question though: I have file called "dump-capability" in the ...activeaccounts/imap dir. Any idea what that is? Maybe generated during restart of dovecot? Must be created bij the imap-wrapper.sh.
No idea what it is, but I see that too.. and the timestamp matches the last time dovecot was started on all servers.
http://wiki.dovecot.org/PostLoginScripting has an example working around the "dump-capability" user..
-jf
participants (2)
-
Egbert Jan van den Bussche
-
Jan-Frode Myklebust