[Web, Dovecot] Add sieve and pop3 to protocol access for app passwords

This commit is contained in:
andryyy
2021-10-29 06:15:10 +02:00
parent 514340b2a7
commit 15ce95e78d
6 changed files with 27 additions and 7 deletions

View File

@@ -164,9 +164,9 @@ function auth_password_verify(req, pass)
end
-- check against app passwds for imap and smtp
-- app passwords are only available for imap and smtp in dovecot
if req.service == "smtp" or req.service == "imap" then
local cur,errorString = con:execute(string.format([[SELECT app_passwd.id, app_passwd.imap_access, app_passwd.smtp_access, app_passwd.password FROM app_passwd
-- app passwords are only available for imap, smtp, sieve and pop3 when using sasl
if req.service == "smtp" or req.service == "imap" or req.service == "sieve" or req.service == "pop3" then
local cur,errorString = con:execute(string.format([[SELECT app_passwd.id, app_passwd.imap_access, app_passwd.smtp_access, app_passwd.sieve_access, app_passwd.pop3_access, app_passwd.password FROM app_passwd
INNER JOIN mailbox ON mailbox.username = app_passwd.mailbox
WHERE mailbox = '%s'
AND app_passwd.%s_access = '1'