From 39e7b84fb0d1481591caccf5405263372aa4d01f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 15 Nov 2016 14:22:28 +0100 Subject: [PATCH] fix removing aliases incl. identity was remove all identities, but the one it was supposed to remove --- admin/admin-cli.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/admin-cli.php b/admin/admin-cli.php index 99941bf40b..d23da2697d 100755 --- a/admin/admin-cli.php +++ b/admin/admin-cli.php @@ -377,7 +377,7 @@ function do_edit_mail($type, array $arg0s) foreach($acc_id ? array(Api\Mail\Account::read($acc_id, $account_id)) : Api\Mail\Account::search($account_id, false) as $account) { - if (!Api\Mail\Account::is_multiple($account)) continue; // no need to waste time on personal accounts + if (!isset($acc_id) && !Api\Mail\Account::is_multiple($account)) continue; // no need to waste time on personal accounts $args = $arg0s; try { @@ -412,13 +412,13 @@ function do_edit_mail($type, array $arg0s) { if (($key = array_search($email, $args)) !== false) { + // delete identities, if "-" is used and email of identity matches given ones and is not standard identity + if ($delete_identity && $ident_id != $account->ident_id) + { + Api\Mail\Account::delete_identity($ident_id); + } unset($args[$key]); } - // delete identities, if "-" is used and email of identity matches given ones and is not standard identity - elseif ($delete_identity && $ident_id != $account->ident_id) - { - Api\Mail\Account::delete_identity($ident_id); - } } // create not existing identities by copying standard identity plus alias as email foreach($args as $email)