diff --git a/lib/Froxlor/Api/Commands/EmailAccounts.php b/lib/Froxlor/Api/Commands/EmailAccounts.php index 0a06f524..d9396ee2 100644 --- a/lib/Froxlor/Api/Commands/EmailAccounts.php +++ b/lib/Froxlor/Api/Commands/EmailAccounts.php @@ -100,8 +100,8 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso // alternative email address to send info to if (Settings::Get('panel.sendalternativemail') == 1) { $alternative_email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($alternative_email, 'alternative_email', '', '', array(), true)); - if (! \Froxlor\Validate\Validate::validateEmail($alternative_email)) { - \Froxlor\UI\Response::standard_error('emailiswrong', $alternative_email, true); + if (!empty($alternative_email) && ! \Froxlor\Validate\Validate::validateEmail($alternative_email)) { + \Froxlor\UI\Response::standard_error('alternativeemailiswrong', $alternative_email, true); } } else { $alternative_email = ''; @@ -236,7 +236,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso $this->mailer()->clearAddresses(); // customer wants to send the e-mail to an alternative email address too - if (Settings::Get('panel.sendalternativemail') == 1) { + if (Settings::Get('panel.sendalternativemail') == 1 && !empty($alternative_email)) { // get template for mail subject $mail_subject = $this->getMailTemplate($customer, 'mails', 'pop_success_alternative_subject', $replace_arr, $this->lng['mails']['pop_success_alternative']['subject']); // get template for mail body diff --git a/lng/english.lng.php b/lng/english.lng.php index 30e71497..f6ccd8dd 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -204,6 +204,7 @@ $lng['error']['mydomain'] = '\'Domain\''; $lng['error']['mydocumentroot'] = '\'Documentroot\''; $lng['error']['loginnameexists'] = 'Loginname %s already exists'; $lng['error']['emailiswrong'] = 'Email-address %s contains invalid characters or is incomplete'; +$lng['error']['alternativeemailiswrong'] = 'The given alternative email address %s to send the credentials to seems to be invalid'; $lng['error']['loginnameiswrong'] = 'Loginname "%s" contains illegal characters.'; $lng['error']['loginnameiswrong2'] = 'Loginname contains too many characters. Only %s characters are allowed.'; $lng['error']['userpathcombinationdupe'] = 'Combination of username and path already exists'; diff --git a/lng/german.lng.php b/lng/german.lng.php index df3f5d2f..2e55bbb1 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -202,6 +202,7 @@ $lng['error']['mydomain'] = '\'Domain\''; $lng['error']['mydocumentroot'] = '\'Documentroot\''; $lng['error']['loginnameexists'] = 'Der Login-Name "%s" existiert bereits.'; $lng['error']['emailiswrong'] = 'Die E-Mail-Adresse "%s" enthält ungültige Zeichen oder ist nicht vollständig.'; +$lng['error']['alternativeemailiswrong'] = 'Die angegebene alternative E-Mail Adresse "%s", an welche die Zugangsdaten geschickt werden soll, scheint ungültig zu sein.'; $lng['error']['loginnameiswrong'] = 'Der Login-Name "%s" enthält ungültige Zeichen.'; $lng['error']['loginnameiswrong2'] = 'Der Login-Name enthält zu viele Zeichen, es sind maximal %s Zeichen erlaubt.'; $lng['error']['userpathcombinationdupe'] = 'Die Kombination aus Benutzername und Pfad existiert bereits.';