Last_login plugin and mysql

Aki Tuomi aki.tuomi at open-xchange.com
Mon Sep 24 09:16:20 EEST 2018



On 23.09.2018 19:20, Thomas Hooge wrote:
> Hello,
>
> i have problems configuring the last_login plugin with mysql.
>
> I have extended the postfixadmin database with a new field,
> configured the plugin as described in the wiki.
>
> Finally i got errors: table is not writable, INSERT failed.
>
> Why is the insert required? The plugin should only UPDATE
> the column for existing rows.
> Or am i missing some configuration options?
> Here is my dictionary config:
>
> map {
>   pattern = shared/last-login/$user
>   table = mailbox
>   value_field = x_last_login
>   value_type = uint
>
>   fields {
>     username = $user
>   }
> }
>
>
> Dovecot: 2.2.27 (c0f36b0)
>
> Kind regards,
> Thomas

last_login plugin uses dict interface, which does not support "update",
it only supports get, set, unset and atomic inc. Set is implemented with
'INSERT INTO foo ... ON DUPLICATE UPDATE'. There is no configuration
setting to change this, as dict cannot know without performing a SELECT
that a value already exists.

Aki


More information about the dovecot mailing list