diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-04-27 13:01:12 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-04-27 13:01:12 +0000 |
| commit | beae9e335f1d5c33dc74f1b9994aef810969e5b6 (patch) | |
| tree | 2352a932444bd8a23ba98864eed82ec8e2b4632b | |
| parent | 5cc93795e62ac3d89a80c18d997b73c455b501f0 (diff) | |
- add DNS checking code for Windows & PHP<5.3.0
git-svn-id: https://svn.roundcube.net/trunk@3569 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/include/main.inc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index 535fde18b..004212ff8 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/program/include/main.inc @@ -1588,8 +1588,15 @@ function check_email($email, $dns_check=true) if (!$dns_check || !rcmail::get_instance()->config->get('email_dns_check')) return true; - if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && version_compare(PHP_VERSION, '5.3.0', '<')) - return true; + if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && version_compare(PHP_VERSION, '5.3.0', '<')) { + $lookup = array(); + @exec("nslookup -type=MX " . escapeshellarg($domain_part) . " 2>&1", $lookup); + foreach ($lookup as $line) { + if (strpos($line, 'MX preference')) + return true; + } + return false; + } // find MX record(s) if (getmxrr($domain_part, $mx_records)) |
