diff -urN ../postfixadmin-3.2.4.orig/functions.inc.php ./functions.inc.php --- ../postfixadmin-3.2.4.orig/functions.inc.php 2020-04-17 11:15:04.000000000 +0300 +++ ./functions.inc.php 2020-09-01 00:18:23.564345000 +0300 @@ -216,10 +216,11 @@ * TODO: skip DNS check if the domain exists in PostfixAdmin? */ function check_domain($domain) { - if (!preg_match('/^([-0-9A-Z]+\.)+' . '([-0-9A-Z]){2,13}$/i', ($domain))) { + if (!preg_match('/^(([-0-9A-Z]+\.)+' . '([-0-9A-Z]){2,13}|localhost)$/i', ($domain))) { return sprintf(Config::lang('pInvalidDomainRegex'), htmlentities($domain)); } + if ($domain != 'localhost') if (Config::bool('emailcheck_resolve_domain') && 'WINDOWS'!=(strtoupper(substr(php_uname('s'), 0, 7)))) { // Look for an AAAA, A, or MX record for the domain @@ -277,7 +278,7 @@ return Config::lang_f('pInvalidMailRegex', $email); } - if (function_exists('filter_var')) { + if ((function_exists('filter_var')) and (!preg_match('/^\S+@localhost$/', $email))) { $check = filter_var($email, FILTER_VALIDATE_EMAIL); if (!$check) { return Config::lang_f('pInvalidMailRegex', $email);