[Dovecot] Any possibility of running query after sucessful login?
Hi,
I'm using finally dovecot 2.0 after quite a smooth upgrade from 1.0 :) with virtual mailboxes stored in sql database.
Sometimes I need to check if a mailbox has been used recently or not. Checking for logins in dovecot logs sometimes means searching through gigabytes of info...
I was just wondering if there is any possibility of running another query after successful login - just to fill some extra field like "last_login"? So far my only idea is to replace user/password query with procedure like login(user,password) that would also return a line as required by user/password query. However, some mysql implementations (for example, standard php-mysql) can't handle procedures which return values - so will it work in dovecot?
Or maybe some other ideas how to do that?
Greetings,
Jacek Osiecki joshua@ceti.pl GG:3828944 I don't want something I need. I want something I want.
On Thu, Feb 16, 2012 at 09:41:52AM +0100, Jacek Osiecki wrote:
I was just wondering if there is any possibility of running another query after successful login - just to fill some extra field like "last_login"?
We touch a file in /var/log/activemailaccounts/$username on every successful login trough postlogin scripting:
http://wiki2.dovecot.org/PostLoginScripting
-jf
On Thu, 16 Feb 2012, Jan-Frode Myklebust wrote:
On Thu, Feb 16, 2012 at 09:41:52AM +0100, Jacek Osiecki wrote:
I was just wondering if there is any possibility of running another query after successful login - just to fill some extra field like "last_login"? We touch a file in /var/log/activemailaccounts/$username on every successful login trough postlogin scripting:
Great, that's exactly what I needed :) Thanks!
Greetings,
Jacek Osiecki joshua@ceti.pl GG:3828944 I don't want something I need. I want something I want.
On Thu, 16 Feb 2012, Jan-Frode Myklebust wrote:
On Thu, Feb 16, 2012 at 09:41:52AM +0100, Jacek Osiecki wrote:
I was just wondering if there is any possibility of running another query after successful login - just to fill some extra field like "last_login"? We touch a file in /var/log/activemailaccounts/$username on every successful login trough postlogin scripting:
By the way, is such thing possible for other processess? For example, I'd like to set in mysql table information that mail has been delivered using lmtp. Would something like this work?
protocol lmtp { mail_plugins = $mail_plugins sieve executable = lmtp postlmtp }
Greetings,
Jacek Osiecki joshua@ceti.pl GG:3828944 I don't want something I need. I want something I want.
On Thu, Feb 16, 2012 at 12:18:15PM +0100, Jacek Osiecki wrote:
By the way, is such thing possible for other processess? For example, I'd like to set in mysql table information that mail has been delivered using lmtp. Would something like this work?
protocol lmtp { mail_plugins = $mail_plugins sieve executable = lmtp postlmtp }
I've been inquiring the same lately, and unfortunately that's not possible. There's no "login" involved with lmtp, and each lmtp-session can have multiple recipients.. Maybe it can be solved trough a global sieve script?
-jf
participants (2)
-
Jacek Osiecki
-
Jan-Frode Myklebust