alecpl
2010-04-27 0f3764e59223d8e9c87f30ce85425c00422ff25d
- add DNS checking code for Windows & PHP<5.3.0


1 files modified
11 ■■■■ changed files
program/include/main.inc 11 ●●●● patch | view | raw | blame | history
program/include/main.inc
@@ -1588,8 +1588,15 @@
    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))