
 ck miller - 2008-11-06 19:36:03
 
Replace getmxrr.php with this code if you use direct delivery on a windows server. It doesn't need the old dns.php:
<?php
/*
 getmxrr.php
 getmxrr for windows workaround using nslookup
 see http://php.net/getmxrr
 cappac 2008
*/
function GetMXRR( $hostname, &$mxhosts, &$weight ) {
    $mxhosts = array();
    $weight = array();
    if (!empty ($hostname) ) {
      $output = "";
      @exec ('%SYSTEMDIRECTORY%\\nslookup.exe -q=mx '.escapeshellarg($hostname), $output);
      $imx=-1;
      foreach ($output as $line) {
        $imx++;
        $parts = "";
        if (preg_match ("/^$hostname\tMX preference = ([0-9]+), mail exchanger = (.*)$/", $line, $parts) ) {
          $weight[$imx] = $parts[1];
          $mxhosts[$imx] = $parts[2];
        }
      }
      return ($imx!=-1);
    }
    return false;
}
?>