ZF-11930: Validate emailaddress that hasn't "MX" records but it has "A" record with option "deep" => TRUE, never checks records "A", "AAAA" , "A6"


Steps: 1. Create a validator emailaddress. (Same as second example on…)

$validator = new Zend_Validate_EmailAddress( array( 'allow' => Zend_Validate_Hostname::ALLOW_DNS, 'mx' => true, 'deep' => true ) );

  1. Use an email which MX records returns FALSE but can provide "A" record. Then isValid() always return FALSE.


TIP: On file "Zend/ValidateEmailAddress.php" function line 442: Function "getmxrr" always return false because there is no "MX" records, and then never executes the code that checks the "A", "AAAA", "A6" records.

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')) { // ...


Is this something that can be fixed for ZF v1.12?