Skip to content
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

Unicode fix #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

StephanRichter
Copy link

This is a minor fix to mitigate the following problem:

the gpg-mailgate.py works nicely as long emails contain only ascii chars:

date | mail -s Test [email protected] nicely encodes the mail, if a respective gpg key is present.

However, if you did something like this:

echo "German text may contain letters like ÄäÖöÜüß and others" | mail -s Test [email protected] it will fail, as smtp.sendmail only accepts ascii strings OR byte data.

This patch fixes that problem.

improving unicode support
fixed comment
fixing another unicode problem when PGP encrypting mails…
@@ -469,7 +469,7 @@ def encrypt_all_payloads_mime( message, gpg_to_cmdline ):

def encrypt_payload( payload, gpg_to_cmdline, check_nested = True ):

raw_payload = payload.get_payload(decode=True)
raw_payload = payload.get_payload().encode()
Copy link
Owner

Choose a reason for hiding this comment

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

why remove the decode here? Sounds like this is required to support mime based encodings like base64 encoded messages, ect..

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