Issue 11927: SMTP_SSL doesn't use port 465 by default (original) (raw)

Created on 2011-04-26 16:48 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
smtplib_default_ports.patch kasun,2011-04-27 11:23 review
smtp_default_port_with_smtpnet_test.patch kasun,2011-05-07 17:29 review
Messages (8)
msg134478 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-04-26 16:48
The SMTP_SSL doc says “If port is omitted, the standard SMTP-over-SSL port (465) is used”, but actually port 25 is used by default. The fix is trivial: make "default_port" a class attribute (in both SMTP and SMTP_SSL) instead of setting it inside the constructor. test_smtpnet uses an explicit port to connect to gmail, which is why it doesn't exhibit the issue. (Kasun, I'm adding you since you might be interested. Sorry if it isn't the case)
msg134551 - (view) Author: Kasun Herath (kasun) Date: 2011-04-27 11:23
I did a quick patch based on the suggested solution. (pitrou, thanks for adding to the nosy list or could have missed this)
msg134563 - (view) Author: Sijin Joseph (sijinjoseph) Date: 2011-04-27 13:39
Should we add a unit test for this as well?
msg134941 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-05-01 23:05
> Should we add a unit test for this as well? True, a simple test could be added to test_smtpnet.
msg135487 - (view) Author: Kasun Herath (kasun) Date: 2011-05-07 17:29
I'm submitting another patch which includes a test in test_smtpnet. Would appreciate further feedback.
msg135492 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-07 17:48
New changeset 20e9d3e49689 by Antoine Pitrou in branch '3.1': Issue #11927: SMTP_SSL now uses port 465 by default as documented. Patch by Kasun Herath. http://hg.python.org/cpython/rev/20e9d3e49689 New changeset 209744660b92 by Antoine Pitrou in branch '3.2': Merge: Issue #11927: SMTP_SSL now uses port 465 by default as documented. http://hg.python.org/cpython/rev/209744660b92 New changeset e708a57de190 by Antoine Pitrou in branch 'default': Merge: Issue #11927: SMTP_SSL now uses port 465 by default as documented. http://hg.python.org/cpython/rev/e708a57de190
msg135495 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-07 17:59
New changeset bcf04ced5ef1 by Antoine Pitrou in branch '2.7': Issue #11927: SMTP_SSL now uses port 465 by default as documented. Patch by Kasun Herath. http://hg.python.org/cpython/rev/bcf04ced5ef1
msg135496 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-05-07 18:01
The patch was committed in dev and maintenance branches. Thank you!
History
Date User Action Args
2022-04-11 14:57:16 admin set github: 56136
2011-05-07 18:01:35 pitrou set status: open -> closedresolution: fixedmessages: + stage: needs patch -> resolved
2011-05-07 17:59:38 python-dev set messages: +
2011-05-07 17:48:51 python-dev set nosy: + python-devmessages: +
2011-05-07 17:29:05 kasun set files: + smtp_default_port_with_smtpnet_test.patchmessages: +
2011-05-01 23:05:38 pitrou set messages: +
2011-04-27 13:39:31 sijinjoseph set nosy: + sijinjosephmessages: +
2011-04-27 11:23:42 kasun set files: + smtplib_default_ports.patchkeywords: + patchmessages: +
2011-04-26 16:48:19 pitrou create