note 10675 added to getmxrr
| From: | paul at start dot co dot uk | Date: | Tue, 16 Jan 2001 17:48:01 +0000 |
| Subject: | note 10675 added to getmxrr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9851@lists.php.net to get a copy of this message | ||
Prevent your dns server from 'creating' a valid host name by appending the local domain to
incomplete emails by appending to the domain a trailing . both in the pattern match and mx checks:
if (eregi("^[0-9a-z_]([-_.]?[0-9a-z])*@[0-9a-z][-.0-9a-z]*\\.[a-z]{2,3}[.]?$", $string,
$check)) {
$host = substr(strstr($check[0], '@'), 1).".";
if ( getmxrr($host, $validate_email_temp) )
return TRUE;
// THIS WILL CATCH DNSs THAT ARE NOT MX.
if(checkdnsrr($host,"ANY"))
return TRUE;
}
return FALSE;
http://www.php.net/manual/en/function.getmxrr.php