[Dovecot] Executing SQL update upon login

Tom Sommer mail at tomsommer.dk
Tue Oct 10 11:51:49 UTC 2006


On Tue, October 10, 2006 11:59, Timo Sirainen wrote:
> On Tue, 2006-10-10 at 09:23 +0200, Tom Sommer wrote:
>
>> Hi,
>>
>>
>> I'm using SQL authentication in dovecot, and was wondering if anyone
>> had any ideas as to how I could run an UPDATE statement upon each login,
>> to set time of last login (and other interesting stuff) in the database
>> table.
>
> Set mail_executable to point to a script:
>
>
> #!/bin/sh
>
>
> echo "update blah where user = '$USER'" | mysql ..
>
> exec /usr/local/libexec/dovecot/imap

Won't the overhead on that be pretty high? Considerings it now has to wrap
the imap command in to a script.

// Tom




More information about the dovecot mailing list