summaryrefslogtreecommitdiff
path: root/Lib/test/test_smtplib.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-38270: Check for hash digest algorithms and avoid MD5 (GH-16382)Christian Heimes2019-09-251-1/+10
| | | | | | | | | | | Make it easier to run and test Python on systems with restrict crypto policies: * add requires_hashdigest to test.support to check if a hash digest algorithm is available and working * avoid MD5 in test_hmac * replace MD5 with SHA256 in test_tarfile * mark network tests that require MD5 for MD5-based digest auth or CRAM-MD5 https://bugs.python.org/issue38270
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-011-1/+1
|
* bpo-35133: Fix mistakes when concatenate string literals on different lines. ↵Serhiy Storchaka2018-11-051-1/+1
| | | | | | | | | | (GH-10284) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings.
* bpo-32680 add default "sock" on SMTP objects (#5345)Romuald Brunet2018-10-091-0/+7
| | | | By default the smtplib.SMTP objects did not have a sock attribute, it was only created during connect()
* bpo-34246: Make sure test_smtplib always cleans resources when finished ↵Pablo Galindo2018-09-081-7/+47
| | | | | | | | (GH-9108) * Make sure that when some of the tests in test_smtplib fail, the allocated threads and sockets are not leaked. * Use support.join_thread() instead of thread.join() to avoid infinite blocks.
* bpo-34246: Use no mutable default args in smtplib (GH-8554)Pablo Aguiar2018-09-071-0/+28
| | | | | Some methods of the SMTP class use mutable default arguments. Specially `send_message` is affected as it mutates one of the args by appending items to it, which has side effects on further calls.
* bpo-32663 Make SMTPUTF8SimTests run (#5314)chason2018-07-251-25/+14
| | | | | | | | | | | Enable and fix SMTPUTF8SimTests in test_smtplib. The tests for SMTPUTF8SimTests in test_smtplib.py were not actually being run because test_smtplib was still using the 'test_main' pattern, and the class was never added to test_main. Additionally, one of the tests needed to be moved to the non-UTF8 server class because it relies on the server not being UTF-8 compatible (and it had a bug in in).
* bpo-32727: smtplib's SMTP.send_message behaves differently with from_addr ↵Stéphane Wirtel2018-01-301-1/+18
| | | | | and to_addrs (#5451) Do not pass the name field in the 'from' address in the SMTP envelope.
* bpo-31234: Join threads in tests (#3572)Victor Stinner2017-09-141-1/+3
| | | | Call thread.join() on threads to prevent the "dangling threads" warning.
* bpo-29639: change test.support.HOST to "localhost"Gregory P. Smith2017-09-091-27/+40
| | | | | | | | | | test.support.HOST should be "localhost" as it was in the past. See the bpo-29639. Tests that need the IP address should use HOSTv4 (added) or the existing HOSTv6 constant. This changes the definition and fixes tests that needed updating to deal with HOST being the hostname rather than the hardcoded IP address. This is only the first step in addressing https://bugs.python.org/issue29639.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-10/+1
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* #25446: Fix regression in smtplib's AUTH LOGIN support.R David Murray2015-11-081-58/+121
| | | | | | | | | | | | | The auth method tests simply weren't adequate because of the fact that smtpd doesn't support authentication. I borrowed some of Milan's code for that from issue #21935 and added it to the smtplib tests. Also discovered that the direct test for the 'auth' method wasn't actually testing anything and fixed it. The fix makes the new authobject mechanism work the way it is documented...the problem was that wasn't checking for a 334 return code if an initial-response was provided, which works fine for auth plain and cram-md5, but not for auth login.
* - Issue #15014: SMTP.auth() and SMTP.login() now support RFC 4954's optionalBarry Warsaw2015-07-091-9/+83
| | | | initial-response argument to the SMTP AUTH command.
* #24218: Add SMTPUTF8 support to send_message.R David Murray2015-05-171-1/+46
| | | | Reviewed by Maciej Szulik.
* #22027: Add RFC6531 support to smtplib.R David Murray2015-05-161-0/+119
| | | | Initial patch by Milan Oberkirch.
* #16914: add timestamps to smtplib debugging output via new debuglevel 2.R David Murray2015-04-161-0/+21
| | | | Patch by Gavin Chappell and Maciej Szulik.
* Merge #22215: have the smtplib 'quit' command reset the state.R David Murray2014-08-301-0/+15
|\
| * #22215: have the smtplib 'quit' command reset the state.R David Murray2014-08-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | Without this reset, starttls would fail if a connect/starttls was done after a quit, because smtplib assumed the existing value of emspt_features was accurate, but it gets reset when starttls completes (and the new value does not contain the starttls capability, since tls is already started at that point). (There may be additional places where this lack of reset was an issue as well.) Patch by Milan Oberkirch.
* | Issue #21566: Make use of socket.listen() default backlog.Charles-François Natali2014-07-231-1/+1
| |
* | #15014: Add 'auth' command to implement auth mechanisms and use it in login.R David Murray2014-07-031-22/+38
| | | | | | | | Patch by Milan Oberkirch.
* | #19662: Eliminate warnings in other test modules that use smtpd.R David Murray2014-06-111-3/+5
|/ | | | Eventually these will want to convert to decode_data=False, I think.
* #17498: Defer SMTPServerDisconnected errors until the next command.R David Murray2014-04-141-0/+13
| | | | | | | | | | | | | Normally an SMTP server will return an error, and smtplib will then issue an RSET to return the connection to the known starting state. Some servers, however, disconnect after issuing certain errors. When we issue the RSET, this would result in raising an SMTPServerDisconnected error, *instead* of returning the error code the user of the library was expecting. This fix makes the internal RSET calls ignore the disconnection so that the error code is returned. The user of the library will then get the SMTPServerDisconnected error the next time they try to talk to the server. Patch by Kushal Das.
* merge with 3.3Georg Brandl2014-02-101-1/+29
|
* Issue #20549: Use specific asserts in mailbox, smtplib and poplib tests.Serhiy Storchaka2014-02-081-3/+3
|\
| * Issue #20549: Use specific asserts in mailbox, smtplib and poplib tests.Serhiy Storchaka2014-02-081-3/+3
| |
* | Closes #6683: add a test that exercises multiple authentication.Andrew Kuchling2013-11-111-0/+9
| | | | | | | | | | The SMTP server advertises four different authentication methods, and the code will try CRAM-MD5 first, which will fail, but LOGIN succeeds.
* | merge 3.3 (#19125)Benjamin Peterson2013-09-291-3/+3
|\ \ | |/
| * fix test to run and test that smtpd does support ELHO (closes #19125)Benjamin Peterson2013-09-291-3/+3
| |
* | Merge: #5713: One more test_smtplib timing fix.R David Murray2013-03-211-1/+1
|\ \ | |/
| * #5713: One more test_smtplib timing fix.R David Murray2013-03-211-1/+1
| |
* | Merge: #5712: Preemptively fix some other possible timing issues.R David Murray2013-03-201-3/+3
|\ \ | |/
| * Merge: #5712: Preemptively fix some other possible timing issues.R David Murray2013-03-201-3/+3
| |\
| | * #5712: Preemptively fix some other possible timing issues.R David Murray2013-03-201-3/+3
| | |
* | | Merge: #5713: fix timing issue in smtplib tests.R David Murray2013-03-201-0/+3
|\ \ \ | |/ /
| * | Merge: #5713: fix timing issue in smtplib tests.R David Murray2013-03-201-0/+3
| |\ \ | | |/
| | * #5713: fix timing issue in smtplib tests.R David Murray2013-03-201-0/+3
| | |
* | | Merge: #5713: Handle 421 error codes during sendmail by closing the socket.R David Murray2013-03-201-9/+65
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | This is a partial fix to the issue of servers disconnecting unexpectedly; in this case the 421 says they are disconnecting, so we close the socket and return the 421 in the appropriate error context. Original patch by Mark Sapiro, updated by Kushal Das, with additional tests by me.
| * | Merge: #5713: Handle 421 error codes during sendmail by closing the socket.R David Murray2013-03-201-9/+65
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | This is a partial fix to the issue of servers disconnecting unexpectedly; in this case the 421 says they are disconnecting, so we close the socket and return the 421 in the appropriate error context. Original patch by Mark Sapiro, updated by Kushal Das, with additional tests by me.
| | * #5713: Handle 421 error codes during sendmail by closing the socket.R David Murray2013-03-201-1/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a partial fix to the issue of servers disconnecting unexpectedly; in this case the 421 says they are disconnecting, so we close the socket and return the 421 in the appropriate error context. Original patch by Mark Sapiro, updated by Kushal Das, with additional tests by me.
* | | Replace IOError with OSError (#16715)Andrew Svetlov2012-12-251-1/+1
| | |
* | | Issue #16717: get rid of socket.error, replace with OSErrorAndrew Svetlov2012-12-181-1/+1
| | |
* | | Cleanup: remove not needed mocks.Andrew Svetlov2012-12-171-6/+0
| | |
* | | Issue #16647: save socket error details in LMTP.connect()Andrew Svetlov2012-12-171-2/+2
|/ / | | | | | | Initial patch by Serhiy Storchaka.
* | #8739: upgrade smtpd to RFC 5321 and 1870.R David Murray2012-05-261-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | smtpd now handles EHLO and has infrastructure for extended smtp command mode. The SIZE extension is also implemented. In order to support parameters on MAIL FROM, the RFC 5322 parser from the email package is used to parse the address "token". Logging subclasses things and overrides __init__, so it was necessary to update those __init__ functions in the logging tests to make the logging tests pass. The original suggestion and patch were by Alberto Trevino. Juhana Jauhiainen added the --size argument and SIZE parameter support. Michele Orrù improved the patch and added more tests. Dan Boswell conditionalized various bits of code on whether or not we are in HELO or EHLO mode, as well as some other improvements and tests. I finalized the patch and added the address parsing.
* | Issue #14442: Add missing errno import in test_smtplib.Ross Lagerwall2012-03-291-0/+1
| |
* | Make tests faster by reaping threads only at the endAntoine Pitrou2011-08-281-4/+1
|\ \ | |/
| * Make tests faster by reaping threads only at the endAntoine Pitrou2011-08-281-4/+1
| |
* | Addressing the review comments by Antoine Pitrou for smtplib.py and ↵Senthil Kumaran2011-07-311-6/+11
| | | | | | | | test_smtplib.py. Review comments by Ezio Melotti for smtplib.rst
* | Fix closes Issue11281 - smtplib.STMP gets source_address parameter, which ↵Senthil Kumaran2011-07-301-0/+17
| | | | | | | | adds the ability to bind to specific source address on a machine with multiple interfaces. Patch by Paulo Scardine.
* | Merge #7484: no more <> around addresses in VRFY or EXPNR David Murray2011-07-181-9/+24
|\ \ | |/