mirror of
https://github.com/Mailu/Mailu.git
synced 2025-01-30 04:30:49 +02:00
Fix #3364
This commit is contained in:
parent
30bb83c42c
commit
ee243ea735
@ -10,15 +10,24 @@ local http_client = dovecot.http.client {
|
|||||||
max_attempts = 3;
|
max_attempts = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- on the other end we use urllib.parse.unquote()
|
||||||
|
function urlEncode(str)
|
||||||
|
return str:gsub("[^%w_.-~]", function(c)
|
||||||
|
return string.format("%%%02X", string.byte(c))
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
function auth_passdb_lookup(req)
|
function auth_passdb_lookup(req)
|
||||||
local auth_request = http_client:request {
|
local auth_request = http_client:request {
|
||||||
url = "http://{{ ADMIN_ADDRESS }}:8080/internal/auth/email";
|
url = "http://{{ ADMIN_ADDRESS }}:8080/internal/auth/email";
|
||||||
}
|
}
|
||||||
auth_request:add_header('Auth-Port', req.local_port)
|
auth_request:add_header('Auth-Port', req.local_port)
|
||||||
auth_request:add_header('Auth-User', req.user)
|
local user = urlEncode(req.user)
|
||||||
|
auth_request:add_header('Auth-User', user)
|
||||||
if req.password ~= nil
|
if req.password ~= nil
|
||||||
then
|
then
|
||||||
auth_request:add_header('Auth-Pass', req.password)
|
local password = urlEncode(req.password)
|
||||||
|
auth_request:add_header('Auth-Pass', password)
|
||||||
end
|
end
|
||||||
auth_request:add_header('Auth-Protocol', req.service)
|
auth_request:add_header('Auth-Protocol', req.service)
|
||||||
auth_request:add_header('Client-IP', req.remote_ip)
|
auth_request:add_header('Client-IP', req.remote_ip)
|
||||||
|
1
towncrier/newsfragments/3364.bugfix
Normal file
1
towncrier/newsfragments/3364.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix a bug preventing percent characters from being used in passwords
|
Loading…
x
Reference in New Issue
Block a user