[Dovecot] Executing SQL update upon login

/dev/rob0 rob0 at gmx.co.uk
Tue Oct 10 14:31:55 UTC 2006


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.
-- 
    Offlist mail to this address is discarded unless
    "/dev/rob0" or "not-spam" is in Subject: header


More information about the dovecot mailing list