The root of this problem is in: /etc/sentora/panel/dryden/fs/director.class.php
PHP Code:
static function CheckForEmptyValue($value) {
if (!empty($value)) {
return false;
} else {
return true;
}
}
1.) practical problem
All the values that are ever passed to this function in mailboxes module (and others safe to presume) consist of TRUE or FALSE and are booleans so this function always satisfies the first criteria.
2.) logical and intuitive problem
For some strange reason there's a double negation here "if not empty than false" but it should return "true" if it aint empty for the intuitive part, or even better it should be "if empty than return false" for logic,
3.) becouse of this strange logic in (2) somebody made a mistake when adding domain validation code to: /panel/modules/mailboxes/code/controller.ext.php
PHP Code:
if (!self::IsValidEmail($fulladdress)) {
self::$validemail = true;
return false;
}
if(!self::IsValidDomain($domain)){
self::$validdomain = true;
return false;
}
as you can see in email validation part a negation is used again to compensate for the bad practice of negation and returning false mentioned in (2) furthermore inside the IsValidEmail it is compensated some more .. it's a mess. anyways whoever added domain validation followed the (no)logic and compensated with negation infront IsValidDomain function BUT this one doesnt comepnsate one more time inside the function so here comes the "the domain was not valid" error. Basically only if it is NOT valid domain the domain is valid boolean is set to TRUE/VALID while whenever the domain is really VALID it results to FALSE.
A simple solution is to remove "!" from "
if(!self::IsValidDomain($domain))" and it will work in all modules where the check is performed.
Next release would be better off refactoring the core functions and logic.