From d95305815a462592c570aebbd9dea0304af7f856 Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 14 Nov 2023 16:27:35 +0200 Subject: [PATCH] if the username contains non-ascii chars, try email address, as Dovecot does NOT deal with non-ascii usernames --- api/src/Mail/Credentials.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/src/Mail/Credentials.php b/api/src/Mail/Credentials.php index bf8fc85c3b..c4f383860e 100644 --- a/api/src/Mail/Credentials.php +++ b/api/src/Mail/Credentials.php @@ -298,6 +298,13 @@ class Credentials */ public static function from_session(array $data, $set_identity=true) { + // if the username contains non-ascii chars, try email address, as Dovecot does NOT deal with non-ascii usernames + if ($data['acc_imap_type'] === Api\Mail\Imap\Dovecot::class && + in_array($data['acc_imap_logintype'], ['standard', 'vmailmgr']) && + preg_match('/[^\x20-\x7e]/', $GLOBALS['egw_info']['user']['account_lid'])) + { + $data['acc_imap_logintype'] = 'email'; + } switch($data['acc_imap_logintype']) { case 'standard':