Re: Re: get domain component from email

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




way to do so by using dns records. It's like 5 lines, here's the site http://www.sitepoint.com/article/users-email-address-php

The requirement for email delivery is not MX, just having an A address
is enough. Also executing external utility program from php is not
optimal from system point of view (extra process that you block for),
its better to just directly use PHP Net/DNS library. This article is
good for beginners:
 http://articles.techrepublic.com.com/5100-22-5234651.html

http://www.cmsws.com/examples/php/domain_verification/example2.php

You end up with hard-coded list where as ICANN may add new TLDs, while
it works fine for developer users start doing this and forget about
having to update it. I recommend getting IANA list and caching it locally:
 http://data.iana.org/TLD/tlds-alpha-by-domain.txt

And yours is fatally flawed. Not all ccTLDs are sub-divided.

More specifically some TLDs do delegation from 3rd level domains
(.co.uk), some from 2nd level (.com) some are mix of 2 or 3 or more
(.kids.us, .us, k12.ca.us). And not only that but some TLDs may even allow direct delivery to TLD - do "dig ws"will not work (such me@tld address is while valid the email would not work because RFC2821
considers it invalid address and because most local mailers would
get confused thinking is partial address where it needs to add local domain part). There is really no specific limit min or max for number deligation levels which together forms valid domain.

--
William Leibzon
Elan Networks
william@xxxxxxxx

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux