Add new TLS support and switch to Python 3#2
Open
BlacklightShining wants to merge 7 commits intotgray:masterfrom
Open
Add new TLS support and switch to Python 3#2BlacklightShining wants to merge 7 commits intotgray:masterfrom
BlacklightShining wants to merge 7 commits intotgray:masterfrom
Conversation
Switched the mixed indentation to spaces with a tabstop of 4, as per PEP 0008. Also aligned line continuations better in some places.
- Renamed theTLSFlag to theTLSMode and converted it from a boolean to a constant-or-none variable (TLS_MODE_NATIVE|TLS_MODE_STARTTLS|None). - Added the tls_versions option and related constants. - Made check_status() take two separate arguments instead of unpacking a tuple. - Caught OSError instead of socket.error and reordered that suite last (smtplib.SMTPException is a subclass of OSError). - Tweaked the code in various ways (using with statements for files, eliminating bare `except`s, using containers' truthiness instead of len(), renaming to avoid shadowing builtins, etc).
Documentation for the new `tls_versions` option was added; the documentation for the `tls` configuration option was updated to reflect the new choices.
Owner
|
I'll have to figure out how to incorporate this if Python 2 support is broken. I just set aside some time for this near the end of the month to see what I can do with it. Thanks for the request. |
I'd rather my hostname not show up in the headers of mail I send. That's probably just me, though. Maybe this should be an option or something.
dict.has_key(key) -> key in dict exception[1] -> str(exception) ConfigParser -> configparser email.Utils -> email.utils Also stopped shadowing the `email` module in that one comprehension on line 517
This means that errors in SMTP.connect() will cause putmail to print specific errors of its own, rather than ERROR_OTHER and a copy of the server's error response. (Probably. I actually made this change months ago and I'll admit to not remembering why.)
Owner
|
Oh dang, I guess I didn't work on this near the end of the month. 😬 It just broke for me under some python 3 install, so I'm going to work on this over the next couple of weeks and get it functioning. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This repository hasn't been active for four years, so I took it for abandoned and thought I'd just keep my own fork. I just now noticed that the owner has been active on GitHub recently, so I thought I'd submit my changes. I'm not expecting everything to be accepted (I did just up and break backwards compatibility with Python 2, after all), but maybe some of it is worth merging.