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

bpo-39259: smtp.SMTP/SMTP_SSL now reject timeout = 0 #17958

Open
wants to merge 1 commit into
base: master
from

Conversation

@corona10
Copy link
Member

corona10 commented Jan 12, 2020

@corona10 corona10 requested a review from python/email-team as a code owner Jan 12, 2020
@corona10 corona10 requested a review from vstinner Jan 12, 2020
@corona10

This comment has been minimized.

Copy link
Member Author

corona10 commented Jan 12, 2020

@vstinner
Discussion needed:

During I work on this PR, I've noticed that LMTP does not support the timeout parameter.
See: https://docs.python.org/3.9/library/smtplib.html#smtplib.LMTP

However, LMTP also able to use the socket which is created from SMTP.

return SMTP.connect(self, host, port, source_address=source_address)

IMHO LMTP needs to support the timeout parameter.

>>> import socket
>>> sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
>>> sock.settimeout(30)
>>> sock.gettimeout()
30.0
>>> b = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
>>> b.gettimeout()
>>>

Also AFAIK, Unix Socket also able to set a timeout which is used for LMTP protocol
If you agree, I would like to create an issue for this.

@corona10 corona10 force-pushed the corona10:bpo-39259-smtplib branch from e1d29a6 to 29cd207 Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.