This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vsergeev
Recipients vsergeev
Date 2012-05-08.21:15:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The SMTPServer class of the smtpd module creates a server socket with the IPv4 socket.AF_INET address family hardcoded, and this prevents it from later binding to an IPv6 local address.

This occurs on line 282 of for the Python 2.7 branch:

And on line 435 of smtpd for the Python 3.2 branch ( Lib/ ):

One IPv4/IPv6 agnostic solution is to look up provided local address with getaddrinfo(), and use one of the result's address family, socket type and address tuple for create_socket() and bind() at those lines:

    gai_results = socket.getaddrinfo(localaddr[0], localaddr[1])
    self.create_socket(gai_results[0][0], gai_results[0][1])
    # try to re-use a server port if possible
Date User Action Args
2012-05-08 21:15:50vsergeevsetrecipients: + vsergeev
2012-05-08 21:15:50vsergeevsetmessageid: <>
2012-05-08 21:15:49vsergeevlinkissue14758 messages
2012-05-08 21:15:49vsergeevcreate