Эх сурвалжийг харах

fix: stabilize Dovecot authentication bridge

Close each Lua passdb HTTP request so Dovecot cannot reuse a connection after the Node bridge keep-alive timeout.

AI-Co-Authored-By: Codex
chendeben 1 сар өмнө
parent
commit
29b7947029

+ 1 - 0
docker/dovecot/auth.lua

@@ -81,6 +81,7 @@ function auth_password_verify(request, password)
   }
   http_request:add_header("content-type", "application/json")
   http_request:add_header("authorization", "Bearer " .. shared_secret)
+  http_request:add_header("connection", "close")
   http_request:set_payload(json.encode {
     username = request.user,
     password = password,

+ 1 - 0
test/dovecot-config.test.js

@@ -90,6 +90,7 @@ test('Lua passdb sends both IMAP and POP3 to the private auth bridge', () => {
   assert.match(authLua, /request_max_attempts = 1/);
   assert.match(authLua, /auto_retry = "no"/);
   assert.match(authLua, /request_absolute_timeout = "2s"/);
+  assert.match(authLua, /add_header\("connection", "close"\)/);
   assert.match(authLua, /status ~= 200[\s\S]*PASSDB_RESULT_INTERNAL_FAILURE/);
   assert.doesNotMatch(authLua, /status == (?:401|403|404)/);
   assert.match(