summaryrefslogtreecommitdiffstats
path: root/Lib/smtplib.py
Commit message (Collapse)AuthorAgeFilesLines
* send(), ehlo(): Integrate patch #487310 by Fazal Majid. ConsistentlyBarry Warsaw2001-12-141-0/+2
| | | | | | | call self.close() just before raising SMTPServerDisconnected. This allows you to, e.g. reconnect after a server timeout. Merged from the 2.2c1 branch.
* SMTPError should be SMTPException; reported by Neal Norwitz.Fred Drake2001-10-131-2/+2
|
* Only close sockets if they have been created. Reported by Blake Winton.Martin v. Löwis2001-10-071-1/+3
|
* Whitespace normalization.Tim Peters2001-09-181-7/+7
|
* SF patch #461413 (Gerhard Häring): Add STARTTLS feature to smtplibGuido van Rossum2001-09-141-2/+54
| | | | | | | | | | | This patch adds the features from RFC 2487 (Secure SMTP over TLS) to the smtplib module: - A starttls() function - Wrapper classes that simulate enough of sockets and files for smtplib, but really wrap a SSLObject - reset the list of known SMTP extensions at each call of ehlo(). This should have been the case anyway.
* Add login() method and SMTPAuthenticationError exception. SF patchGuido van Rossum2001-09-111-3/+93
| | | | | | | | #460112 by Gerhard Haering. (With slight layout changes to conform to docstrings guidelines and to prevent a line longer than 78 characters. Also fixed some docstrings that Gerhard didn't touch.)
* Remove redundant importAndrew M. Kuchling2001-08-131-1/+1
|
* Initialize msg to avoid unbound locals.Martin v. Löwis2001-07-311-0/+1
|
* Untabify IPv6 changes.Martin v. Löwis2001-07-261-16/+16
|
* Patch #401196: Use getaddrinfo and AF_INET6 in TCP servers and clients.Martin v. Löwis2001-07-241-12/+20
|
* bunch more __all__ listsSkip Montanaro2001-02-151-0/+5
| | | | | | also modified check_all function to suppress all warnings since they aren't relevant to what this test is doing (allows quiet checking of regsub, for instance)
* Aha. We can remove he string import after all by using ValueError.Eric S. Raymond2001-02-091-2/+1
|
* Fixed a bug in the test jig.Eric S. Raymond2001-02-091-1/+1
|
* String method conversion.Eric S. Raymond2001-02-091-13/+13
|
* Whitespace normalization.Tim Peters2001-01-151-31/+31
|
* Update the code to better reflect recommended style:Fred Drake2000-12-121-6/+6
| | | | | Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
* SMTP.connect(): If the socket.connect() raises a socket.error, be sureBarry Warsaw2000-11-081-1/+5
| | | | | to call self.close() to reclaim some file descriptors, the reraise the exception. Closes SF patch #102185 and SF bug #119833.
* Applied patch #101350, closing it.Barry Warsaw2000-09-011-1/+3
|
* Use socket.getfqdn() instead of defining make_fqdn().Fred Drake2000-08-161-27/+2
|
* Apply SF patch #101151, by Peter S-K, which fixes smtplib's passing of theThomas Wouters2000-08-151-13/+27
| | | | | | 'helo' and 'ehlo' message, and exports the 'make_fqdn' function. This function should be moved to socket.py, if that module ever gets a Python wrapper.
* add better algorithm to get fully qualified domain name for localhostPeter Schneider-Kamp2000-08-101-17/+21
| | | | | | | in smtplib.ehlo() and smtplib.helo(). closes patch #101103 closes bug #110935
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-161-2/+2
| | | | | | | | | | comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
* Use TQSQ (triple quoted single quote) module docstring for betterBarry Warsaw2000-07-091-2/+2
| | | | font-locking. This complets the merge with Mailman's version.
* Fredrik Lundh:Guido van Rossum2000-03-281-1/+1
| | | | | This fixes a bunch of socket.connect(host, post) calls. Note that I haven't tested all modules -- I don't have enough servers here...
* Simple changes by Gerrit Holl - move author acknowledgements out ofGuido van Rossum2000-02-281-8/+8
| | | | docstrings into comments.
* Actually, the previous batch's comment should have been different;Guido van Rossum2000-02-041-2/+2
| | | | | | | | | | *this* set of patches is Ka-Ping's final sweep: The attached patches update the standard library so that all modules have docstrings beginning with one-line summaries. A new docstring was added to formatter. The docstring for os.py was updated to mention nt, os2, ce in addition to posix, dos, mac.
* A bunch of docstring fixes.Barry Warsaw1999-11-281-23/+22
|
* In helo() and ehlo(), Don't fail when gethostbyaddr() fails -- justGuido van Rossum1999-10-221-2/+10
| | | | keep whatever gethostname() returns. After a suggestion by Doug Wyatt.
* Patch by Per Cederqvist:Guido van Rossum1999-06-091-3/+6
| | | | | | | I've found two places where smtplib.py sends an extra trailing space on command lines to the SMTP server. I don't know if this ever causes any problems, but I'd prefer to be on the safe side. The enclosed patch removes the extra space.
* Patch by Per Cederqvist, seemingly approved by The Dragon:Guido van Rossum1999-04-211-3/+6
| | | | | | | Two problems: The SMTPRecipientsRefused class should not inherit SMTPResponseException, since it doesn't provide the smtp_code and smtp_error attributes. My patch for not adding an extra CRLF was apparently forgotten. The enclosed patch fixes these two problems.
* Changes by Per Cederquist and The Dragon.Guido van Rossum1999-04-071-49/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per writes: """ The application where Signum Support uses smtplib needs to be able to report good error messages to the user when sending email fails. To help in diagnosing problems it is useful to be able to report the entire message sent by the server, not only the SMTP error code of the offending command. A lot of the functions in sendmail.py unfortunately discards the message, leaving only the code. The enclosed patch fixes that problem. The enclosed patch also introduces a base class for exceptions that include an SMTP error code and error message, and make the code and message available on separate attributes, so that surrounding code can deal with them in whatever way it sees fit. I've also added some documentation to the exception classes. The constructor will now raise an exception if it cannot connect to the SMTP server. The data() method will raise an SMTPDataError if it doesn't receive the expected 354 code in the middle of the exchange. According to section 5.2.10 of RFC 1123 a smtp client must accept "any text, including no text at all" after the error code. If the response of a HELO command contains no text self.helo_resp will be set to the empty string (""). The patch fixes the test in the sendmail() method so that helo_resp is tested against None; if it has the empty string as value the sendmail() method would invoke the helo() method again. The code no longer accepts a -1 reply from the ehlo() method in sendmail(). [Text about removing SMTPRecipientsRefused deleted --GvR] """ and also: """ smtplib.py appends an extra blank line to the outgoing mail if the `msg' argument to the sendmail method already contains a trailing newline. This patch should fix the problem. """ The Dragon writes: """ Mostly I just re-added the SMTPRecipientsRefused exception (the exeption object now has the appropriate info in it ) [Per had removed this in his patch --GvR] and tweaked the behavior of the sendmail method whence it throws the newly added SMTPHeloException (it was closing the connection, which it shouldn't. whatever catches the exception should do that. ) I pondered the change of the return values to tuples all around, and after some thinking I decided that regularizing the return values was too much of the Right Thing (tm) to not do. My one concern is that code expecting an integer & getting a tuple may fail silently. (i.e. if it's doing : x.somemethod() >= 400: expecting an integer, the expression will always be true if it gets a tuple instead. ) However, most smtplib code I've seen only really uses the sendmail() method, so this wouldn't bother it. Usually code I've seen that calls the other methods usually only calls helo() and ehlo() for doing ESMTP, a feature which was not in the smtplib included with 1.5.1, and thus I would think not much code uses it yet. """
* Patch by Per Cederqvist, who writes:Guido van Rossum1999-03-291-6/+15
| | | | | | | | | | | | | | | | """ - It needlessly used the makefile() method for each response that is read from the SMTP server. - If the remote SMTP server closes the connection unexpectedly the code raised an IndexError. It now raises an SMTPServerDisconnected exception instead. - The code now checks that all lines in a multiline response actually contains an error code. """ The Dragon approves.
* Patch by Piers Lauder: make exceptions classes.Guido van Rossum1999-01-151-14/+13
| | | | Take opportunity to add more explanatory messages to exceptions.
* In rcpt(), avoid a space after the TO: address when the option list isGuido van Rossum1999-01-141-2/+2
| | | | empty. Make sure there is a space when there are options.
* Small, and final docstring merge with Dragon's version.Barry Warsaw1998-12-221-1/+5
|
* A few other docstring fixes, most importantly to be a little nicer toBarry Warsaw1998-12-221-54/+59
| | | | Emacs ;-)
* Nothing earthshattering, just some fixes to typos and other formattingBarry Warsaw1998-12-221-50/+53
| | | | bugs in various docstrings.
* Change interface to sendmail: if the destination address is a stringJeremy Hylton1998-08-131-1/+6
| | | | | | | instead of a list, turn it into a list containing that string. This avoids an apparently common newbie mistake -- passing in a single string for the destination and have it treated as a sequence of characters.
* Untabified and deleted trailing blank lines.Guido van Rossum1998-08-101-9/+7
|
* Latest version by The Dragon, who writes:Guido van Rossum1998-08-041-66/+120
| | | | | | | | I did some bugfixes, and fixed a major problem with the esmtp suport (I think the person who did that part misunderstood RFC1869) Some of the interface fer esmtp-related things has changed as a result. I also added some documentation to the SMTP class' docstring.
* Better RFC 821 compliance (MAIL and RCPT, and CRLF in data)Guido van Rossum1998-07-131-15/+37
| | | | by Carey Evans <c.evans@clear.net.nz>, for picky mail servers.
* Eric Raymond added support for ESMTP protocol and corrected some typosGuido van Rossum1998-06-251-33/+113
| | | | in comments and doc strings.
* Add optional argument to help().Guido van Rossum1998-04-031-2/+2
|
* Mass check-in after untabifying all files that need it.Guido van Rossum1998-03-261-71/+71
|
* Sez The Dragon:Guido van Rossum1998-01-291-24/+25
| | | | | Ok, I fixed the quotes, along with a bug or two. Also added another exception.
* SMTP client by The Dragon De Monsyne <dragondm@integral.org>.Guido van Rossum1998-01-291-0/+278