From 4f3e9fa06c61bfdc78e0bf1aab55486391ee82de Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 28 Mar 2022 17:58:41 +0300 Subject: [PATCH] do NOT attempt to use credentials encrypted with user password in an async context (where user password is not available) otherwise an s/mime certificate or user specific password will stall sending notification, even if no smtp authentication required --- api/src/Mail/Credentials.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/src/Mail/Credentials.php b/api/src/Mail/Credentials.php index a5482d24b9..d2e54e52f4 100644 --- a/api/src/Mail/Credentials.php +++ b/api/src/Mail/Credentials.php @@ -210,6 +210,12 @@ class Credentials $on_login = array(__CLASS__.'::migrate', $acc_id); } } + // do NOT attempt to use credentials encrypted with user password in an async context (where user password is not available) + // otherwise an s/mime certificate or user specific password will stall sending notification, even if no smtp authentication required + if (!empty($GLOBALS['egw_info']['flags']['async-service']) && in_array($row['cred_pw_enc'], [self::USER_AES, self::USER])) + { + continue; + } $password = self::decrypt($row); // Remove special x char added to the end for \0 trimming escape. @@ -833,4 +839,4 @@ class Credentials { return isset($GLOBALS['egw_setup']) ? $GLOBALS['egw_setup']->db : $GLOBALS['egw']->db; } -} +} \ No newline at end of file