summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-04-27 13:01:12 +0000
committeralecpl <alec@alec.pl>2010-04-27 13:01:12 +0000
commit0f3764e59223d8e9c87f30ce85425c00422ff25d (patch)
tree8c8f8133bda8d2ec86dc386caad754231113c05c /program/include
parenta7890113c6806baecae0718ae60ed2d71055dda5 (diff)
- add DNS checking code for Windows & PHP<5.3.0
Diffstat (limited to 'program/include')
-rw-r--r--program/include/main.inc11
1 files changed, 9 insertions, 2 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 535fde18b..004212ff8 100644
--- a/program/include/main.inc
+++ b/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))