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

Parsing Problems with Python 3.9 #6

Open
chtugha opened this issue Feb 18, 2021 · 2 comments
Open

Parsing Problems with Python 3.9 #6

chtugha opened this issue Feb 18, 2021 · 2 comments

Comments

@chtugha
Copy link

chtugha commented Feb 18, 2021

Hi, i get following errors trying to run your script with windows

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Program Files\mailproxy-master>python mailproxy.py
('127.0.0.1', 49304) SMTP session exception
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-p
ackages\aiosmtpd\smtp.py", line 647, in _handle_client
await method(arg)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-p
ackages\aiosmtpd\smtp.py", line 1358, in smtp_DATA
status = await self._call_handler_hook('DATA')
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-p
ackages\aiosmtpd\smtp.py", line 415, in _call_handler_hook
status = await hook(self, self.session, self.envelope, *args)
File "C:\Program Files\mailproxy-master\mailproxy.py", line 26, in handle_DATA

refused = self._deliver(envelope)

File "C:\Program Files\mailproxy-master\mailproxy.py", line 45, in _deliver
s.connect(self._host, self._port)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\smtpli
b.py", line 339, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\smtpli
b.py", line 1041, in _get_socket
new_socket = self.context.wrap_socket(new_socket,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\ssl.py
", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\ssl.py
", line 1031, in _create
self._sslobj = self._context._wrap_socket(
ValueError: server_hostname cannot be an empty string or start with a leading do
t.

@ibv
Copy link

ibv commented Nov 25, 2021

Hi,
for starttls at me this helped https://stackoverflow.com/questions/51768041/python3-smtp-valueerror-server-hostname-cannot-be-an-empty-string-or-start-with

s = smtplib.SMTP(self._host)

s.connect(self._host, self._port)

@dancysoft
Copy link

@chtugha I have a fork of this repository at https://github.com/dancysoft/mailproxy which has the fix suggested by @ibv.

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

No branches or pull requests

3 participants