note 103123 added to function.getmxrr

From: Date: Sun, 27 Mar 2011 14:21:00 +0000
Subject: note 103123 added to function.getmxrr
Groups: php.notes 
Request: Send a blank email to php-notes+get-178249@lists.php.net to get a copy of this message
I tried using getmxrr() to validate the domain portion of email addresses in enquiry submission forms, and there is a curious effect with some top-level domains when checking non-existant domains. With sdlkfjsdl.com, since the domain does not exist, getmxrr() returns false, as expected, and the returned mxhosts array is empty. But with sdlkfjsdl.gov, getmxrr() returns true, and the returned mxhosts array contains one element: NULL With sdlkfjsdl.org, getmxrr() returns true, and the returned mxhosts array contains one element: '0.0.0.0' With sdlkfjsdl.co.uk, getmxrr() returns true and supplies one MX record: uk-net-wildcard-null-mx.centralnic.net So to validate the email domain, it would seem one has to check the returned mxhosts array to exclude the possibility of mxhosts being returned as NULL, 0.0.0.0 and wildcard ... ---- Server IP: 69.147.83.197 Probable Submitter: 62.147.172.132 ---- Manual Page -- http://www.php.net/manual/en/function.getmxrr.php Edit -- https://master.php.net/note/edit/103123 Del: integrated -- https://master.php.net/note/delete/103123/integrated Del: useless -- https://master.php.net/note/delete/103123/useless Del: bad code -- https://master.php.net/note/delete/103123/bad+code Del: spam -- https://master.php.net/note/delete/103123/spam Del: non-english -- https://master.php.net/note/delete/103123/non-english Del: in docs -- https://master.php.net/note/delete/103123/in+docs Del: other reasons-- https://master.php.net/note/delete/103123 Reject -- https://master.php.net/note/reject/103123 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#178249) next »