Giter Site home page Giter Site logo

Comments (6)

stromvirvel avatar stromvirvel commented on May 20, 2024 1

Okay, this was easier than I thought 😃

See:
https://docs.python.org/2/library/email.message.html?highlight=quoted%20printable#email.message.Message.get_payload

Optional decode is a flag indicating whether the payload should be decoded or not, according to the Content-Transfer-Encoding header.

I only had to set decode=true in get_payload(). Additionally, I cannot reproduce the same problem with a multipart message. I guess this is because of the different way you are getting the payload.

However, I could not find an according flag in python3 documentation:
https://docs.python.org/3/library/email.message.html

Can you test this code with py3 (I don't understand your python test file for now)?

from zeyple.

infertux avatar infertux commented on May 20, 2024

Thanks a lot for the thorough writeup. Looking at the comment above, it seems we're deleting the header to fix a bug in Thunderbird. IIRC this used to crash Thunderbird a while ago. I would suggest to simply remove this line thereby keeping the header intact then check if Thunderbird has been fixed. Do you use Thunderbird by any chance?

from zeyple.

stromvirvel avatar stromvirvel commented on May 20, 2024

Simply leaving the header doesn't help aswell, as it applies to the encrypted text in the mail payload. Encrypted data never has umlauts in it. We really need to decode the quoted-printable text, re-encode to UTF8, and then encrypt.

I'm currently using Apple Mail :-)

from zeyple.

infertux avatar infertux commented on May 20, 2024

Hmm okay I don't see why we need to decode the quoted-printable text though. Is this how Thunderbird and Apple Mail handle it? Sorry I can't investigate that right now.

On a side note, I'd like to avoid adding dependencies as much as possible, especially if it's not compatible with Python 3.

from zeyple.

stromvirvel avatar stromvirvel commented on May 20, 2024

I may be wrong, but if you simply encrypt a string =E4, how could gpg know that =E4 is encoded? The header only applies to the mail client, but not to gpg (AFAIK).

But I have to do further investigation. I'll test if simply leaving the header alive would actually help, and come back to you later.

from zeyple.

stromvirvel avatar stromvirvel commented on May 20, 2024

I can confirm, that leaving the header Content-Transfer-Encoding: quoted-printable doesn't fix this problem. It doesn't even help when I add the same header to the attached inline file "encrypted.asc".

I'll write a proof of concept (hopefully without adding dependencies ;-)) and come back to you later.

from zeyple.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.