pagekite/Mailpile — pull request #225 by ulikoehler (2013-10-26 21:35:44+00:00)
Title: Improve _HostNameCheck

This adds support for IPv6 adresses (by adding ':' to NODNS character set) + unit tests and instead of using the compare-with-cleaned-text algorithms, it now uses a straightforward is-any-of-the-blacklisted-chars-contained-in-the-hostname-algorithm. However, it is still not perfect, now it sees "localhost:1234" as valid hostname.

I'd like to reduce inter-dependencies and simplify algorithms in Mailpile, so please forgiveme if I sometimes change your algorithms.

DNS is now checked too, unless it's an IPv6 address (or the optional function argument is set to False)..
Python (at least my 2.7 version, on Ubuntu) seems to have poor IPv6 support in the socket module ATM, see http://www.python-forum.de/viewtopic.php?p=154742 (german, see last post. AF_INET is hardcoded.).

Merging would be highly appreciated!