[dev] [commits] Horde branch develop updated. 2cd26a26e02a3c15e50c6a7bbf2f59397288f9bf

Jan Schneider jan at horde.org
Wed Aug 29 15:41:02 UTC 2012


Zitat von Michael M Slusarz <slusarz at horde.org>:

> Quoting Jan Schneider <jan at horde.org>:
>
>> It's not about false negatives but false positives, which we care  
>> about in this our use case. See my committed test.
>
> This test is wrong:
>
>         $address3 = new Horde_Mail_Rfc822_Address('Test  
> <test at example.co.uk>');
> [...]
>         $this->assertFalse($address3->matchDomain('co.uk'));
>
> This should be:
>
>         $this->assertTrue($address3->matchDomain('co.uk'));
>
> The address "test at example.co.uk" is in the domain "co.uk".  So  
> matchDomain('co.uk') SHOULD return true. 'example.co.uk' is, by  
> definition, a subdomain of 'co.uk'.  From RFC 1034:
>
> "A domain is a subdomain of another domain if it is contained within  
> that domain."
>
> Put another way:
>
> $address = new Horde_Mail_Rfc822_Address('Test <test at example.com>');
> $this->assertTrue($address->matchDomain('com'));
>
> 'com' is a perfectly valid domain.  And 'example.com' is in the 'com' domain.

Granted, this is technically correct. But isn't the use-case to verify  
if an address is from a domain that can be "owned"?
-- 
Jan Schneider
The Horde Project
http://www.horde.org/



More information about the dev mailing list