original_string: protected function _getMx($host)
      {
          $mx = array();
  
          if ($this->params['netdns']) {
              $this->_loadNetDns();
  
              try {
                  $response = $this->_resolver->query($host, 'MX');
                  if (!$response) {
                      return false;
                  }
              } catch (Exception $e) {
                  throw new Horde_Mail_Exception($e);
              }
  
              foreach ($response->answer as $rr) {
                  if ($rr->type == 'MX') {
                      $mx[$rr->exchange] = $rr->preference;
                  }
              }
          } else {
              $mxHost = $mxWeight = array();
  
              if (!getmxrr($host, $mxHost, $mxWeight)) {
                  return false;
              }
  
              for ($i = 0; $i < count($mxHost); ++$i) {
                  $mx[$mxHost[$i]] = $mxWeight[$i];
              }
          }
  
          asort($mx);
  
          return $mx;
      }
code: protected function _getMx($host)
      {
          $mx = array();
  
          if ($this->params['netdns']) {
              $this->_loadNetDns();
  
              try {
                  $response = $this->_resolver->query($host, 'MX');
                  if (!$response) {
                      return false;
                  }
              } catch (Exception $e) {
                  throw new Horde_Mail_Exception($e);
              }
  
              foreach ($response->answer as $rr) {
                  if ($rr->type == 'MX') {
                      $mx[$rr->exchange] = $rr->preference;
                  }
              }
          } else {
              $mxHost = $mxWeight = array();
  
              if (!getmxrr($host, $mxHost, $mxWeight)) {
                  return false;
              }
  
              for ($i = 0; $i < count($mxHost); ++$i) {
                  $mx[$mxHost[$i]] = $mxWeight[$i];
              }
          }
  
          asort($mx);
  
          return $mx;
      }
code_tokens: protected function _getMx ( $ host ) { $ mx = array ( ) ; if ( $ this -> params [ 'netdns' ] ) { $ this -> _loadNetDns ( ) ; try { $ response = $ this -> _resolver -> query ( $ host , 'MX' ) ; if ( ! $ response ) { return false ; } } catch ( Exception $ e ) { throw new Horde_Mail_Exception ( $ e ) ; } foreach ( $ response -> answer as $ rr ) { if ( $ rr -> type == 'MX' ) { $ mx [ $ rr -> exchange ] = $ rr -> preference ; } } } else { $ mxHost = $ mxWeight = array ( ) ; if ( ! getmxrr ( $ host , $ mxHost , $ mxWeight ) ) { return false ; } for ( $ i = 0 ; $ i < count ( $ mxHost ) ; ++ $ i ) { $ mx [ $ mxHost [ $ i ] ] = $ mxWeight [ $ i ] ; } } asort ( $ mx ) ; return $ mx ; }
docstring: Recieve MX records for a host.
  
  @param string $host  Mail host.
  
  @return mixed  Sorted MX list or false on error.
docstring_tokens: Recieve MX records for a host .