Skip to content

Conversation

@BlacklightShining
Copy link

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.

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.
@tgray
Copy link
Owner

tgray commented Oct 1, 2015

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.)
@tgray
Copy link
Owner

tgray commented Apr 4, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants