remove 'default_password_scheme' for dovecot configs as hashes can be different now and are read by given hash-algo prefix;

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-11-12 09:38:43 +01:00
parent f49fd5f0f7
commit 1d938f2a43
14 changed files with 248 additions and 194 deletions

View File

@@ -424,6 +424,22 @@ class MailsTest extends TestCase
$json_result = EmailAccounts::getLocal($customer_userdata, $data)->add();
$result = json_decode($json_result, true)['data'];
$this->assertEquals(1, $result['popaccountid']);
switch (Settings::Get('system.passwordcryptfunc')) {
case PASSWORD_ARGON2I:
$cpPrefix = '{ARGON2I}';
break;
case PASSWORD_ARGON2ID:
$cpPrefix = '{ARGON2ID}';
break;
default:
$cpPrefix = '{BLF-CRYPT}';
break;
}
// password is not being returned by API, so query directly
$sel_stmt = Database::prepare("SELECT `password_enc` FROM `" . TABLE_MAIL_USERS . "` WHERE `email` = :email");
$result2 = Database::pexecute_first($sel_stmt, ['email' => $result['email']]);
$this->assertEquals($cpPrefix, substr($result2['password_enc'], 0, strlen($cpPrefix)));
}
public function testAdminEmailAccountsUpdate()