[Dovecot] Executing SQL update upon login

Timo Sirainen tss at iki.fi
Tue Oct 10 15:02:32 UTC 2006


On 10.10.2006, at 16.31, /dev/rob0 wrote:

> On Tuesday 10 October 2006 05:51, Tom Sommer wrote:
>>>> 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.
>
> I doubt overhead would be much of a problem, since all the shells will
> use shared memory. The problem I see is that at the time you're  
> running
> the update, you have not yet authenticated the user, so your data  
> could
> be unreliable.

No, mail_executable is run only after a successful authentication.
-------------- 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/20061010/e26d5cb0/attachment.pgp 


More information about the dovecot mailing list