Plugin 'Address Take' : Checkdnsrr doesn't work with windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

 

in the ‘Address Take’ plugin the Checkdnsrr function is used. This function is not implemented in PHP for windows (see http://nl3.php.net/checkdnsrr for more info). I found a resolution to this problem.

Add this code to the functions library of the Address plugin:

 

if(!function_exists('checkdnsrr'))

{

    function checkdnsrr($hostName, $recType = '')

    {

     if(!empty($hostName)) {

       if( $recType == '' ) $recType = "MX";

       exec("nslookup -type=$recType $hostName", $result);

       // check each line to find the one that starts with the host

       // name. If it exists then the function succeeded.

       foreach ($result as $line) {

         if(eregi("^$hostName",$line)) {

           return true;

         }

       }

       // otherwise there was no mail handler for the domain

       return false;

     }

     return false;

    }

}

 

Sincerely,

 

Sebastiaan Mannem

sebas@xxxxxxxxx

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
squirrelmail-users mailing list
Posting Guidelines: http://www.squirrelmail.org/wiki/MailingListPostingGuidelines
List Address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
List Archives:  http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

[Index of Archives]     [Video For Linux]     [Yosemite News]     [Yosemite Photos]     [gtk]     [KDE]     [Cyrus SASL]     [Gimp on Windows]     [Steve's Art]     [Webcams]

  Powered by Linux