diff --git a/api/src/Mail/Smtp.php b/api/src/Mail/Smtp.php index 9748bfa154..0a207c6041 100644 --- a/api/src/Mail/Smtp.php +++ b/api/src/Mail/Smtp.php @@ -233,10 +233,23 @@ class Smtp * default use $this->loginType * @return string */ - /*static*/ public function mailbox_addr($account,$domain=null,$mail_login_type=null) + public function mailbox_addr($account, $domain=null, $mail_login_type=null) + { + return self::mailbox_address($account, $domain ?? $this->defaultDomain, $mail_login_type ?? $this->loginType); + } + + /** + * Build mailbox address for given account and mail_addr_type + * + * If $account is an array (with values for keys account_(id|lid|email), it does NOT call accounts class + * + * @param int|array $account account_id or whole account array with values for keys + * @param string $domain domain + * @param string $mail_login_type=null standard(uid), vmailmgr(uid@domain), email or uidNumber + * @return string + */ + static public function mailbox_address($account, string $domain, string $mail_login_type=null) { - if (is_null($domain)) $domain = $this->defaultDomain; - if (is_null($mail_login_type)) $mail_login_type = $this->loginType; switch($mail_login_type) { diff --git a/api/src/Mail/Smtp/Sql.php b/api/src/Mail/Smtp/Sql.php index a750244350..83a443cf83 100644 --- a/api/src/Mail/Smtp/Sql.php +++ b/api/src/Mail/Smtp/Sql.php @@ -340,7 +340,7 @@ class Sql extends Mail\Smtp } } - // let interesed parties know account was update + // let interested parties know account was update Api\Hooks::process(array( 'location' => 'mailaccount_userdata_updated', 'account_id' => $_uidnumber,