dovecot: enable authentication cache

This commit is contained in:
link2xt
2023-10-15 19:54:29 +00:00
parent 9b438a7a96
commit 862b09d268
3 changed files with 5 additions and 4 deletions

View File

@@ -59,7 +59,7 @@ def handle_dovecot_request(msg, db):
if short_command == "L": # LOOKUP if short_command == "L": # LOOKUP
parts = msg[1:].split("\t") parts = msg[1:].split("\t")
keyname, user = parts[:2] keyname, user = parts[:2]
namespace, type, arg = keyname.split("/", 3) namespace, type, *args = keyname.split("/")
reply_command = "F" reply_command = "F"
res = "" res = ""
if namespace == "shared": if namespace == "shared":
@@ -70,7 +70,7 @@ def handle_dovecot_request(msg, db):
else: else:
reply_command = "N" reply_command = "N"
elif type == "passdb": elif type == "passdb":
res = lookup_passdb(db, user, password=arg) res = lookup_passdb(db, user, password=args[0])
if res: if res:
reply_command = "O" reply_command = "O"
else: else:

View File

@@ -1,5 +1,5 @@
uri = proxy:/run/dovecot/doveauth.socket:auth uri = proxy:/run/dovecot/doveauth.socket:auth
iterate_disable = yes iterate_disable = yes
default_pass_scheme = plain default_pass_scheme = plain
password_key = passdb/%w password_key = passdb/%w/%u
user_key = userdb/%u user_key = userdb/%u

View File

@@ -8,6 +8,7 @@ auth_verbose = yes
auth_debug = yes auth_debug = yes
auth_debug_passwords = yes auth_debug_passwords = yes
auth_verbose_passwords = plain auth_verbose_passwords = plain
auth_cache_size = 100M
# Authentication for system users. # Authentication for system users.
passdb { passdb {