private function _validateMXRecords()
    {
        $mxHosts = array();
        $result = getmxrr($this->_hostname, $mxHosts);
        if (!$result) {
            $this->_error(self::INVALID_MX_RECORD);
        } else if ($this->_options['deep'] && function_exists('checkdnsrr')) {
            $validAddress = false;
            $reserved     = true;
            foreach ($mxHosts as $hostname) {
                $res = $this->_isReserved($hostname);
                if (!$res) {
                    $reserved = false;
                }

                if (!$res
                    && (checkdnsrr($hostname, "A")
                    || checkdnsrr($hostname, "AAAA")
                    || checkdnsrr($hostname, "A6"))) {
                    $validAddress = true;
                    break;
                }
            }

            if (!$validAddress) {
                $result = false;
                if ($reserved) {
                    $this->_error(self::INVALID_SEGMENT);
                } else {
                    $this->_error(self::INVALID_MX_RECORD);
                }
            }
        }

        return $result;
    }
private function _validateMXRecords()
    {
        $mxHosts = array();
        $result = getmxrr($this->_hostname, $mxHosts);
        if (!$result) {
            $this->_error(self::INVALID_MX_RECORD);
        } else if ($this->_options['deep'] && function_exists('checkdnsrr')) {
            $validAddress = false;
            $reserved     = true;
            foreach ($mxHosts as $hostname) {
                $res = $this->_isReserved($hostname);
                if (!$res) {
                    $reserved = false;
                }

                if (!$res
                    && (checkdnsrr($hostname, "A")
                    || checkdnsrr($hostname, "AAAA")
                    || checkdnsrr($hostname, "A6"))) {
                    $validAddress = true;
                    break;
                }
            }

            if (!$validAddress) {
                $result = false;
                if ($reserved) {
                    $this->_error(self::INVALID_SEGMENT);
                } else {
                    $this->_error(self::INVALID_MX_RECORD);
                }
            }
        }

        return $result;
    }
private function _validateMXRecords ( ) { $ mxHosts = array ( ) ; $ result = getmxrr ( $ this -> _hostname , $ mxHosts ) ; if ( ! $ result ) { $ this -> _error ( self :: INVALID_MX_RECORD ) ; } else if ( $ this -> _options [ 'deep' ] && function_exists ( 'checkdnsrr' ) ) { $ validAddress = false ; $ reserved = true ; foreach ( $ mxHosts as $ hostname ) { $ res = $ this -> _isReserved ( $ hostname ) ; if ( ! $ res ) { $ reserved = false ; } if ( ! $ res && ( checkdnsrr ( $ hostname , "A" ) || checkdnsrr ( $ hostname , "AAAA" ) || checkdnsrr ( $ hostname , "A6" ) ) ) { $ validAddress = true ; break ; } } if ( ! $ validAddress ) { $ result = false ; if ( $ reserved ) { $ this -> _error ( self :: INVALID_SEGMENT ) ; } else { $ this -> _error ( self :: INVALID_MX_RECORD ) ; } } } return $ result ; }
Internal method to validate the servers MX records

@return boolean
Internal method to validate the servers MX records