-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modernize massmail #95
Open
otizonaizit
wants to merge
47
commits into
master
Choose a base branch
from
modernize
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
make massmail installable using more modern techniques: - pyproject.toml (supports editable installation since at least setuptools 66.1.1, but maybe even earlier) - automatically generate massmail script on installation
all in one commit because the rewrite was not functional in the development stages: - use click for the command line interface [this makes for a much more consistent and clear CLI] - port to the modern interface of the email stdlib module [takes care automatically of encoding issues and it is way more pythonic] - do not use stdin anymore for the body, we use required options for both the parameter file and the body text: no more confusion about which is which like in the old interface! - line count cut by almost half :-))) TODO: - write a callback for checking that CLI arguments that should be email address are indeed email addresses! - rewrite the tests so that they work and add more tests - detect use of stdin -> this means we are called using the old interace: we can generate a good error message!
...we make a heavy use of the pytest fixture system, which makes for much clearer and compact test code
…email body ... get_content is documented, but does not automatically handle decoding of 8bit transferred emails. get_payload is not documented, but is used internally by the email module and it handles correctly the decoding...
… of the email body" This commit was based on some wrong assumptions. Actually get_content should always take care of the proper transfer encoding. If it doesn't there is a bug in the email module and we shouldn't try to work around it here. This reverts commit 3155974.
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.
After reading that
smtpd
will be removed from Python in the upcoming 3.12 release after a very long deprecation phase, I decided to givemassmail
a serious re-spin.massmail
a proper package :-)aiosmtpd
for testingclick
for creating the CLI: this is not only much more compact than before, we now have also proper error reporting for wrong options and wrong valuesrich
for coloring of the output and for progress barsemail-validator
for properly validate email addressesemail
module from the standard librarysmtplib
module from the standard librarystdin
. Now everything is an option to the CLImassmail
complain when stuff seems weird in the parameter file or in the body textThis PR is going to be difficult to review by looking at the diff: not a lot of the original code has survived. It is probably easier to just look at the raw files. It is just two files after all ;-)
This PR fixes #93, fixes #87, fixes #46, fixes #41, fixes #21. fixes #18, fixes #14, fixes #13, fixes #11, fixes #9, fixes #7 , fixes #6 fixes #4, fixes #2
These PRs are made obsolete by this PR: fixes #92, fixes #91, fixes #90, fixes #89, fixes #88, fixes #86, fixes #85