summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_smtplib.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-65495: Use lowercase `mail from` and `rcpt to` in `smtplib.SMTP` (#107019)Matthieu Caneill2023-07-221-0/+14
| | | | | | Use lowercase `mail from` and `rcpt to` in `smtplib.SMTP` SMTP commands are case-insensitive. `smtplib` uses lowercase commands, however it writes `mail FROM` and `rcpt TO`, lacking consistency.
* gh-72719: Remove asyncore and asynchat modules (#96580)Nikita Sobolev2022-11-081-3/+1
| | | | | Remove modules asyncore and asynchat, which were deprecated by PEP 594. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-93243: Make smtpd private before porting its users (GH-93246)Oleg Iarygin2022-08-061-1/+1
| | | | | | | gh-93243 This PR is required to reduce diffs of the following porting (no need to either maintain documentation and tests consistent with each porting step, or try to port everything and remove smtpd in a single PR). Automerge-Triggered-By: GH:warsaw
* gh-92169: Use warnings_helper.import_deprecated() to import deprecated ↵Hugo van Kemenade2022-05-031-5/+5
| | | | modules uniformly in tests (GH-92170)
* bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)Christian Heimes2022-03-221-0/+2
| | | | | | | | | | | - Add requires_fork and requires_subprocess to more tests - Skip extension import tests if dlopen is not available - Don't assume that _testcapi is a shared extension - Skip a lot of socket tests that don't work on Emscripten - Skip mmap tests, mmap emulation is incomplete - venv does not work yet - Cannot get libc from executable The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).
* bpo-40479: Fix hashlib's usedforsecurity for OpenSSL 3.0.0 (GH-30455)Christian Heimes2022-01-131-2/+2
|
* Revert "bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)" ↵Victor Stinner2021-12-071-2/+6
| | | | | (GH-29951) This reverts commit 9bf2cbc4c498812e14f20d86acb61c53928a5a57.
* bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)Victor Stinner2021-11-151-6/+2
| | | | | | | | | | | | | | | | Remove the asyncore and asynchat modules, deprecated in Python 3.6: use the asyncio module instead. Remove the smtpd module, deprecated in Python 3.6: the aiosmtpd module can be used instead, it is based on asyncio. * Remove asyncore, asynchat and smtpd documentation * Remove test_asyncore, test_asynchat and test_smtpd * Rename Lib/asynchat.py to Lib/test/support/_asynchat.py * Rename Lib/asyncore.py to Lib/test/support/_asyncore.py * Rename Lib/smtpd.py to Lib/test/support/_smtpd.py * Remove DeprecationWarning from private _asyncore, _asynchat and _smtpd modules * _smtpd: remove deprecated properties
* bpo-43124: Fix smtplib multiple CRLF injection (GH-25987)Miguel Brito2021-08-291-0/+55
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44498: suppress DeprecationWarnings for asynchat, asyncore and smtpd in ↵Irit Katriel2021-06-241-2/+6
| | | | tests (GH-26905)
* bpo-27820: Fix AUTH LOGIN logic in smtplib.SMTP (GH-24118)Pandu E POLUAN2021-03-121-1/+44
| | | | | | * Fix auth_login logic (bpo-27820) * Also fix a longstanding bug in the SimSMTPChannel.found_terminator() method that causes inability to test SMTP AUTH with initial_response_ok=False.
* bpo-42756: Configure LMTP Unix-domain socket to use global default timeout ↵Ross2021-01-011-0/+11
| | | | when timeout not provided (GH-23969)
* bpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)Christian Heimes2020-11-201-2/+2
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-40275: Adding threading_helper submodule in test.support (GH-20263)Hai Shi2020-05-271-16/+16
|
* bpo-9216: hashlib usedforsecurity fixes (GH-20258)Christian Heimes2020-05-221-0/+1
| | | | | | | | | func:`hashlib.new` passed ``usedforsecurity`` to OpenSSL EVP constructor ``_hashlib.new()``. test_hashlib and test_smtplib handle strict security policy better. Signed-off-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: @tiran
* bpo-40275: Move requires_hashdigest() to test.support.hashlib_helper (GH-19716)Hai Shi2020-04-291-2/+2
| | | Add a new test.support.hashlib_helper submodule.
* bpo-40275: Avoid importing socket in test.support (GH-19603)Serhiy Storchaka2020-04-251-3/+4
| | | | | | * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
* bpo-39329: Add timeout parameter for smtplib.LMTP constructor (GH-17998)Dong-hee Na2020-01-141-30/+45
|
* bpo-39259: smtp.SMTP/SMTP_SSL now reject timeout = 0 (GH-17958)Dong-hee Na2020-01-141-0/+5
|
* bpo-38614: Use support timeout constants (GH-17572)HEADmasterVictor Stinner2019-12-111-18/+31
|
* bpo-38614: Use test.support.LOOPBACK_TIMEOUT constant (GH-17554)Victor Stinner2019-12-101-29/+56
| | | | | Replace hardcoded timeout constants in tests with LOOPBACK_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once.
* 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-071-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-311-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
|\ \ | |/