last_login plugin with MySQL

Gedalya gedalya at gedalya.net
Sat Oct 18 14:10:25 UTC 2014


On 10/18/2014 10:05 AM, Gedalya wrote:
> On 10/18/2014 09:33 AM, Luigi Rosa wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Luigi Rosa wrote on 18/10/2014 11:29:
>>> Hi, I have a Dovecot test installation with MySQL userbase and
>>> authentication where I am trying to setup last_login plugin with SQL
>>> dictionary
>> I figured out I have to use dovecot-dict-sql.conf.ext instead of
>> dovecot-sql.conf.ext
>>
>> I configured dovecot-dict-sql.conf.ext this way:
>>
>> driver= mysql
>> connect = {the connect string that works for user lookup}
>> map {
>>    pattern = last-login
>>    table = mailbox
>>    username_field = username
>> }
>>
>> And I defined the plugin this way:
>>
>> plugin {
>>    last_login_dict = sql:/etc/dovecot/dovecot-dict-sql.conf.ext
>>    last_login_key = last-login/%u # default
>> }
>>
>> But I still get the same error:
>>
>> Error: last_login_dict: 
>> dict_init(sql:/etc/dovecot/dovecot-dict-sql.conf.ext)
>> failed: Unknown dict module: sql
>>
>>
> It's been said here before, and I'll echo it again -- better 
> documentation for dict would be helpful, a step-by-step guide to its 
> principles of operation, rather than just the anecdotal examples we 
> have, out of which we're supposed to extrapolate.

"The above SQL example uses dictionary proxy process (see below), 
because SQL libraries aren't linked to all Dovecot binaries. The file 
and Redis examples use direct access. "

http://wiki2.dovecot.org/Quota/Dict

I guess you have to use the proxy.

So maybe something like

plugin {
    last_login_dict = proxy::lastlogin
}

dict {
   lastlogin = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
}

I'll try it later myself, thanks for taking it thus far :-) I've been 
meaning to try this out but was rather perplexed.




More information about the dovecot mailing list