Thank you very much. I hope it will be helpful.
On Mon, Feb 17, 2025 at 3:55 PM Timo Sirainen via dovecot <[email protected]>
wrote:
On 17. Feb 2025, at 13.01, Timo Sirainen via dovecot
<[email protected]> wrote:
>
> On 17. Feb 2025, at 12.46, Timo Sirainen via dovecot
<[email protected]> wrote:
>> Also I've attached a patch that allows using auth-workers with
PostgreSQL with Dovecot v2.4. Maybe it'll be in v2.4.1.
>>
>> passdb sql {
>> use_worker = yes
>> }
>
> Well, attachments don't seem to work on this list, so here's inline
patch. Should work, but I didn't write a test for it yet:
>
> commit 9fcc97ba3c336746d868ab17d04392972884befd
> Author: Timo Sirainen <[email protected]>
> Date: Mon Feb 17 12:39:11 2025 +0200
>
> auth: Allow configuring passdb/userdb sql to use auth-workers
>
> If passdb/userdb_use_worker=yes, this overrides the sql-driver
specific
> worker decision.
>
> diff --git a/src/auth/passdb-sql.c b/src/auth/passdb-sql.c
> index 614344f66a..db1990dc47 100644
> --- a/src/auth/passdb-sql.c
> +++ b/src/auth/passdb-sql.c
> @@ -321,7 +321,8 @@ static void passdb_sql_init(struct
passdb_module *_module)
> enum sql_db_flags flags;
>
> flags = sql_get_flags(module->db);
> - module->module.blocking = (flags & SQL_DB_FLAG_BLOCKING) !=
0;
> + if (!module->module.blocking)
> + module->module.blocking = (flags &
SQL_DB_FLAG_BLOCKING) != 0;
>
> if (!module->module.blocking || worker)
> db_sql_connect(module->db);
> diff --git a/src/auth/userdb-sql.c b/src/auth/userdb-sql.c
> index 671f494d82..aac0fb0de6 100644
> --- a/src/auth/userdb-sql.c
> +++ b/src/auth/userdb-sql.c
> @@ -334,7 +334,8 @@ static void userdb_sql_init(struct
userdb_module *_module)
> enum sql_db_flags flags;
>
> flags = sql_get_flags(module->db);
> - _module->blocking = (flags & SQL_DB_FLAG_BLOCKING) != 0;
> + if (_module->blocking)
Of course, tiny mistake there: if (!_module->blocking)
> + _module->blocking = (flags & SQL_DB_FLAG_BLOCKING) !=
0;
>
> if (!_module->blocking || worker)
> db_sql_connect(module->db);
>
> _______________________________________________
> dovecot mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]