Skip to content
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

Fix for ValueError: server_hostname #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

romaan7
Copy link

@romaan7 romaan7 commented Apr 7, 2020

A python3.7 bug, pass the hostname to smtplib.SMTP for fixing it.

ansible/ansible#44552

Full Stacktrace:

ling.com [email protected] smtp.office365.com connect: ('smtp.office365.com', 587) connect: to ('smtp.office365.com', 587) None reply: b'220 LO2P123CA0016.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 7 Apr 2020 13:09:35 +0000\r\n' reply: retcode (220); Msg: b'LO2P123CA0016.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 7 Apr 2020 13:09:35 +0000' connect: b'LO2P123CA0016.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 7 Apr 2020 13:09:35 +0000' send: 'ehlo LAPTOP-SL6JSTP1.Greyhound.local\r\n' reply: b'250-LO2P123CA0016.outlook.office365.com Hello [109.255.38.119]\r\n' reply: b'250-SIZE 157286400\r\n' reply: b'250-PIPELINING\r\n' reply: b'250-DSN\r\n' reply: b'250-ENHANCEDSTATUSCODES\r\n' reply: b'250-STARTTLS\r\n' reply: b'250-8BITMIME\r\n' reply: b'250-BINARYMIME\r\n' reply: b'250-CHUNKING\r\n' reply: b'250 SMTPUTF8\r\n' reply: retcode (250); Msg: b'LO2P123CA0016.outlook.office365.com Hello [109.255.38.119]\nSIZE 157286400\nPIPELINING\nDSN\nENHANCEDSTATUSCODES\nSTARTTLS\n8BITMIME\nBINARYMIME\nCHUNKING\nSMTPUTF8' send: 'STARTTLS\r\n' reply: b'220 2.0.0 SMTP server ready\r\n' reply: retcode (220); Msg: b'2.0.0 SMTP server ready' Traceback (most recent call last): File "smtptest.py", line 86, in <module> if options.usetls: server.starttls() File "C:\Users\roman.shaikh.GREYHOUND\AppData\Local\Programs\Python\Python37\lib\smtplib.py", line 771, in starttls server_hostname=self._host) File "C:\Users\roman.shaikh.GREYHOUND\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 423, in wrap_socket session=session File "C:\Users\roman.shaikh.GREYHOUND\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 863, in _create owner=self, session=self._session, ValueError: server_hostname cannot be an empty string or start with a leading dot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant