Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c1d52063
Commit
c1d52063
authored
May 07, 2011
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #11927: SMTP_SSL now uses port 465 by default as documented. Patch by Kasun Herath.
parent
63e4230c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
2 deletions
+15
-2
Lib/smtplib.py
Lib/smtplib.py
+4
-2
Lib/test/test_smtpnet.py
Lib/test/test_smtpnet.py
+7
-0
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/smtplib.py
View file @
c1d52063
...
...
@@ -219,6 +219,7 @@ class SMTP:
ehlo_msg = "ehlo"
ehlo_resp = None
does_esmtp = 0
default_port = SMTP_PORT
def __init__(self, host='', port=0, local_hostname=None,
timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
...
...
@@ -234,7 +235,6 @@ class SMTP:
"""
self.timeout = timeout
self.esmtp_features = {}
self.default_port = SMTP_PORT
if host:
(code, msg) = self.connect(host, port)
if code != 220:
...
...
@@ -749,13 +749,15 @@ if _have_ssl:
are also optional - they can contain a PEM formatted private key and
certificate chain file for the SSL connection.
"""
default_port
=
SMTP_SSL_PORT
def
__init__
(
self
,
host
=
''
,
port
=
0
,
local_hostname
=
None
,
keyfile
=
None
,
certfile
=
None
,
timeout
=
socket
.
_GLOBAL_DEFAULT_TIMEOUT
):
self
.
keyfile
=
keyfile
self
.
certfile
=
certfile
SMTP
.
__init__
(
self
,
host
,
port
,
local_hostname
,
timeout
)
self
.
default_port
=
SMTP_SSL_PORT
def
_get_socket
(
self
,
host
,
port
,
timeout
):
if
self
.
debuglevel
>
0
:
print
(
'connect:'
,
(
host
,
port
),
file
=
stderr
)
...
...
Lib/test/test_smtpnet.py
View file @
c1d52063
...
...
@@ -17,6 +17,13 @@ class SmtpSSLTest(unittest.TestCase):
server
.
ehlo
()
server
.
quit
()
def
test_connect_default_port
(
self
):
support
.
get_attribute
(
smtplib
,
'SMTP_SSL'
)
with
support
.
transient_internet
(
self
.
testServer
):
server
=
smtplib
.
SMTP_SSL
(
self
.
testServer
)
server
.
ehlo
()
server
.
quit
()
def
test_main
():
support
.
run_unittest
(
SmtpSSLTest
)
...
...
Misc/ACKS
View file @
c1d52063
...
...
@@ -335,6 +335,7 @@ Malte Helmert
Lance Finn Helsten
Jonathan Hendry
James Henstridge
Kasun Herath
Chris Herborth
Ivan Herman
Jürgen Hermann
...
...
Misc/NEWS
View file @
c1d52063
...
...
@@ -66,6 +66,9 @@ Core and Builtins
Library
-------
- Issue #11927: SMTP_SSL now uses port 465 by default as documented. Patch
by Kasun Herath.
- Issue 11999: fixed sporadic sync failure mailbox.Maildir due to its trying to
detect mtime changes by comparing to the system clock instead of to the
previous value of the mtime.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment