Migration to 2.4: Howto get the quota dict writing into a second DB
Dear Dovecot wizards!
I have a question concerning the migration from 2.3.4 to 2.4.1.
On 2.3.4 I had the following config
dict { sql_store_user_quota = pgsql:/etc/dovecot/dovecot-sql-store-user_quota.conf }
With /etc/dovecot/dovecot-sql-store-user_quota.conf:
connect = host=127.0.0.1 port=5433 dbname=dddd user=uuuu password=pppp:
map { pattern = priv/quota/storage table = fill_user username_field = username value_field = bytes } map { pattern = priv/quota/messages table = messages_user username_field = username value_field = messages }
On 2.4.1 I tried
dict_map priv/quota/storage { sql_table = emailaddress_fill username_field = emailaddress dict_map_value_field quota_bytes { type = uint } } dict fill { sql_driver = pgsql pgsql pg_mc2 { parameters { dbname = dddd host = hhhh password = ppppp user = uuuuu } } }
But it is doing nothing. Am sure I am missing something here (I guess howto connect these config snippets). Any help appreciated.
Cheers,
Volker
--
inqbus Scientific Computing GmbH Dr. Volker Jaenisch Hungerbichlweg 3 +49 (8860) 9222 7 92 86977 Burggen https://inqbus.de
On 26/01/2026 16:03, volker.jaenisch--- via dovecot wrote:
Dear Dovecot wizards!
I have a question concerning the migration from 2.3.4 to 2.4.1.
On 2.3.4 I had the following config
dict { sql_store_user_quota = pgsql:/etc/dovecot/dovecot-sql-store-user_quota.conf }
With /etc/dovecot/dovecot-sql-store-user_quota.conf:
connect = host=127.0.0.1 port=5433 dbname=dddd user=uuuu password=pppp:
map { pattern = priv/quota/storage table = fill_user username_field = username value_field = bytes } map { pattern = priv/quota/messages table = messages_user username_field = username value_field = messages }
On 2.4.1 I tried
dict_map priv/quota/storage { sql_table = emailaddress_fill username_field = emailaddress dict_map_value_field quota_bytes { type = uint } } dict fill { sql_driver = pgsql pgsql pg_mc2 { parameters { dbname = dddd host = hhhh password = ppppp user = uuuuu } } }
But it is doing nothing. Am sure I am missing something here (I guess howto connect these config snippets). Any help appreciated.
Cheers,
Volker
Hi Volker
my understanding is that Dict Quota is not available in 2.4, which could be the reason it isn't doing anything.
https://doc.dovecot.org/2.4.2/installation/upgrade/2.3-to-2.4.html
Even though I didn't get the time to upgrade to 2.4 as of yet, I already migrated on 2.3 to using the Quota Count which manages the quota internally in Dovecot and then on top of that I configured the quota-clone plugin which can replicate the data to a supported database.
John
This looks a lot like quota_clone configuration. That still supports dict AFAIK, though it was a bit fiddly to enable when I was having to deal with it as in particular the way you have to set it up in the config file looks quite a bit different.
Only real reference here seems to be the "more complex example using SQL" at the bottom of the examples here: https://doc.dovecot.org/2.4.2/core/plugins/quota_clone.html#example-configur...
Presumably you'd need to just set your sql_driver to pgsql. Otherwise your old setup and the new quota clone config at least looks somewhat similar so I doubt it'll be too much hassle to trial and error your way to success :)
Cheers,
Thomas "Andy" Baugh | Software Development Engineer IV andy.baugh@webpros.com http://www.webpros.com/
From: volker.jaenisch--- via dovecot <dovecot@dovecot.org> Sent: Monday, January 26, 2026 9:03 AM To: Aki Tuomi via dovecot <dovecot@dovecot.org> Subject: Migration to 2.4: Howto get the quota dict writing into a second DB
Dear Dovecot wizards!
I have a question concerning the migration from 2.3.4 to 2.4.1.
On 2.3.4 I had the following config
dict {
sql_store_user_quota =
pgsql:/etc/dovecot/dovecot-sql-store-user_quota.conf
}
With /etc/dovecot/dovecot-sql-store-user_quota.conf:
connect = host=127.0.0.1 port=5433 dbname=dddd user=uuuu password=pppp:
map {
pattern = priv/quota/storage
table = fill_user
username_field = username
value_field = bytes
}
map {
pattern = priv/quota/messages
table = messages_user
username_field = username
value_field = messages
}
On 2.4.1 I tried
dict_map priv/quota/storage {
sql_table = emailaddress_fill
username_field = emailaddress
dict_map_value_field quota_bytes {
type = uint
}
}
dict fill {
sql_driver = pgsql
pgsql pg_mc2 {
parameters {
dbname = dddd
host = hhhh
password = ppppp
user = uuuuu
}
}
}
But it is doing nothing. Am sure I am missing something here (I guess
howto connect these config snippets). Any help appreciated.
Cheers,
Volker
--
===========================================================
inqbus Scientific Computing GmbH Dr. Volker Jaenisch
Hungerbichlweg 3 +49 (8860) 9222 7 92
86977 Burggen https://inqbus.de/
===========================================================
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-leave@dovecot.org
Dear Andy!
Thanks for the insights.
I changed the config in accordance to the example to:
dict_server { dict quota { sql_driver = pgsql pgsql pg_mc2 { parameters { dbname = dddd host = hhhh password = pppp user = uuuu } } } dict_map priv/quota/storage { sql_table = emailaddress_fill username_field = emailaddress dict_map_value_field quota_bytes { type = uint } } } quota_clone { dict proxy { name = quota } }
Dovecot accepts this config.
Then I tried to use the dict:
doveadm dict get -u service@xxx.xx quota priv/quota/storage Error: cmd dict get: dict_init() failed: dict { .. } named list filter is missing
I do not understand what is missing here? Is my command not correct or the config?
Any pointers appreciated
Cheers,
Volker
--
inqbus Scientific Computing GmbH Dr. Volker Jaenisch Hungerbichlweg 3 +49 (8860) 9222 7 92 86977 Burggen https://inqbus.de
On 29/01/2026 16:27 EET volker.jaenisch--- via dovecot <dovecot@dovecot.org> wrote:
Dear Andy!
Thanks for the insights.
I changed the config in accordance to the example to:
dict_server { dict quota { sql_driver = pgsql pgsql pg_mc2 { parameters { dbname = dddd host = hhhh password = pppp user = uuuu } } } dict_map priv/quota/storage { sql_table = emailaddress_fill username_field = emailaddress dict_map_value_field quota_bytes { type = uint } } } quota_clone { dict proxy { name = quota } }
Dovecot accepts this config.
Then I tried to use the dict:
doveadm dict get -u service@xxx.xx quota priv/quota/storage Error: cmd dict get: dict_init() failed: dict { .. } named list filter is missing
I do not understand what is missing here? Is my command not correct or the config?
Any pointers appreciated
Cheers,
Volker
Try doveadm dict get -u service@xxx.xx quota_clone priv/quota/storage
Aki
Dear Aki!
Thanks for the lightning fast reply!
doveadm dict get -uservice@xxx.xx quota_clone priv/quota/storage
Error: cmd dict get: dict_lookup(priv/quota/storage) failed: Connection closed (reply took 0.000 secs (0.001 in dict wait, 0.000 in other ioloops, 0.000 in locks))
The log shows:
2026-01-29 15:34:53 dict(860894): Error: quota: Failed to initialize dictionary 'quota': Unknown dict module: quota
So I guess my config is not correct.
Cheers, Volker
--
inqbus Scientific Computing GmbH Dr. Volker Jaenisch Hungerbichlweg 3 +49 (8860) 9222 7 92 86977 Burggen https://inqbus.de
--
inqbus Scientific Computing GmbH Dr. Volker Jaenisch Hungerbichlweg 3 +49 (8860) 9222 7 92 86977 Burggen https://inqbus.de
On 29/01/2026 16:37 EET volker.jaenisch--- via dovecot <dovecot@dovecot.org> wrote:
Dear Aki!
Thanks for the lightning fast reply!
doveadm dict get -uservice@xxx.xx quota_clone priv/quota/storage
Error: cmd dict get: dict_lookup(priv/quota/storage) failed: Connection closed (reply took 0.000 secs (0.001 in dict wait, 0.000 in other ioloops, 0.000 in locks))
The log shows:
2026-01-29 15:34:53 dict(860894): Error: quota: Failed to initialize dictionary 'quota': Unknown dict module: quota
So I guess my config is not correct.
Cheers, Volker
dict_server { dict quota { driver = sql sql_driver = pgsql
...
Aki
Dear Aki!
You are my saviour! It works - partly :-)
Nut now I get DB connection errors, which I can handle on my own.
Cheers,
Volker
--
inqbus Scientific Computing GmbH Dr. Volker Jaenisch Hungerbichlweg 3 +49 (8860) 9222 7 92 86977 Burggen https://inqbus.de
Dear All!
doveadm -v dict get -u service@xxx.xx quota_clone priv/quota/storage
does work now. It fetches the information from my PG DB. That is fine.
But what I need is a different functionality.
Upon e.g.
doveadm quota recalc -u service@xxx.xx
dovecot shall fill my DB table with the current storage demand of this postbox.
ATM doveadm quota recalc -u service@xxx.xx does nothing not even an error in the logs.
What would be the configuration for this task: Dovecot fills my DB with the current fill information of the postboxes?
Cheers,
Volker
--
inqbus Scientific Computing GmbH Dr. Volker Jaenisch Hungerbichlweg 3 +49 (8860) 9222 7 92 86977 Burggen https://inqbus.de
participants (4)
-
Aki Tuomi
-
Andy Baugh
-
John Fawcett
-
volker.jaenisch@inqbus.de