Skip to content

bpo-36261: email example was misusing preamble field #14751

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

Merged
merged 1 commit into from
Jul 14, 2019

Conversation

carlbordum
Copy link
Contributor

@carlbordum carlbordum commented Jul 13, 2019

Copy link
Contributor

@mangrisano mangrisano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Contributor

@aeros aeros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. This correctly addresses the issue described and for consistency, using the same preamble found in email-dir.py.

However, since this format is exactly the same, I wonder if it would better to create a pre-configured setup to use as part of the EmailMessage class (as a private method) instead of replicating these 5 lines in different locations:

msg = EmailMessage()
msg['Subject'] = 'Contents of directory %s' % os.path.abspath(directory)
msg['To'] = ', '.join(args.recipients)
msg['From'] = args.sender
msg.preamble = 'You will not see this in a MIME-aware mail reader.\n'

@zooba zooba merged commit 8efade9 into python:master Jul 14, 2019
@miss-islington
Copy link
Contributor

Thanks @carlbordum for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 14, 2019
…nGH-14751)

(cherry picked from commit 8efade9)

Co-authored-by: Carl Bordum Hansen <carl@bordum.dk>
@bedevere-bot
Copy link

GH-14760 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 14, 2019
…nGH-14751)

(cherry picked from commit 8efade9)

Co-authored-by: Carl Bordum Hansen <carl@bordum.dk>
@bedevere-bot
Copy link

GH-14761 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Jul 14, 2019
)

(cherry picked from commit 8efade9)

Co-authored-by: Carl Bordum Hansen <carl@bordum.dk>
miss-islington added a commit that referenced this pull request Jul 14, 2019
)

(cherry picked from commit 8efade9)

Co-authored-by: Carl Bordum Hansen <carl@bordum.dk>
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants