New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
smtplib does not fully support IPv6 in EHLO #47711
Comments
On an IPv6-only machine, smtplib does not send an IPv6 address in the Further, SMTP's __init__() method tries to determine the value of EHLO The attached patch moves the self.local_hostname processing into the |
I intended testing this but the patch file appears to have a dangling else at the bottom, or am I missing something? |
You're right. My mistake when I made the patch. I've attached a new one without the trailing else |
Ran test_smtplib.py for Python 2.7 and 3.1.2 on Windows Vista all tests passed. |
The patch still needs unit tests. |
I'm not sure how to best write a unit test for this. The patch should only be invoked if the client doesn't have a name-served hostname and has IPv6 enabled. Also, there are several IPv4-isms in the smtplib tests. |
You might want to take a look at Lib/test/test_ftplib.py which contains IPv6 tests including the necessary logic to decide whether or not running them. |
Trying to apply patch python/cpython#47711 so we get IPv6 support
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: