Dan Trainor
2006-Sep-25 19:55 UTC
[Dovecot] Preforming an action/trigger after a user successfully authenticates
Hi - I have searched the docs for v1.0 RC7, but cannot find what I'm looking for. What I'm ultimately wanting to do is have Dovecot preform some action, or a trigger, when the user is successfully authenticated. Even more specifically, I'd like to run another SQL query to record a date/time for last authenticated login. Short from running a script during logrotate, or constantly tailing the log, is there any mechanism in Dovecot that would allow me to do this? Again, all I'm looking to do is to record the last date/time that someone successfully logged in, into a MySQL database. Thanks! -dant
Timo Sirainen
2006-Sep-25 19:59 UTC
[Dovecot] Preforming an action/trigger after a user successfully authenticates
On Mon, 2006-09-25 at 12:55 -0700, Dan Trainor wrote:> Hi - > > I have searched the docs for v1.0 RC7, but cannot find what I'm looking for. > > What I'm ultimately wanting to do is have Dovecot preform some action, > or a trigger, when the user is successfully authenticated. Even more > specifically, I'd like to run another SQL query to record a date/time > for last authenticated login. > > Short from running a script during logrotate, or constantly tailing the > log, is there any mechanism in Dovecot that would allow me to do this? > Again, all I'm looking to do is to record the last date/time that > someone successfully logged in, into a MySQL database.Change mail_executable to point to a script containing something like: #!/bin/sh echo "update table ..." | mysql exec /usr/libexec/dovecot/imap/imap And same for pop3 if you use that. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20060925/c8b6e859/attachment.bin>
Geert Hendrickx
2006-Sep-25 20:36 UTC
[Dovecot] Preforming an action/trigger after a user successfully authenticates
On Mon, Sep 25, 2006 at 12:55:31PM -0700, Dan Trainor wrote:> What I'm ultimately wanting to do is have Dovecot preform some action, or > a trigger, when the user is successfully authenticated. Even more > specifically, I'd like to run another SQL query to record a date/time for > last authenticated login.At least in PostgreSQL, you can define TRIGGERs on the SELECT's themselves. Of course you still don't know whether the login was successful, but this way you could log every login _attempt_ automatically. Grrty