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

OpenPGP encrypted e-mails have wrong Content-Type #197

Open
wiktor-k opened this issue Apr 16, 2021 · 5 comments
Open

OpenPGP encrypted e-mails have wrong Content-Type #197

wiktor-k opened this issue Apr 16, 2021 · 5 comments

Comments

@wiktor-k
Copy link

Hi,

Thanks for this project!

I'm using gmi to sync folders (which works great) and to send e-mail which works mostly okay with one minor issue: PGP encrypted e-mails. (for the record I'm using these instructions).

The e-mail being sent has this header:

Content-Type: multipart/encrypted; boundary="=-=-="; protocol="application/pgp-encrypted"

But the receiving side gets something like this:

Content-Type: multipart/mixed; boundary="0000000000003a7d6005c015156b"

And this change confuses many e-mail clients (most notably Thunderbird) into thinking it's not encrypted (while it is).

Funnily enough it seems the original message is correctly stored in Gmail's Sent folder.

I think this may be a limitation of Gmail's API as I've heard rumors that this is the reason why Flowcrypt (that also uses Gmail API) doesn't send PGPMIME messages (but I'm not sure) but even if it is I think it'd be good to at least mention this limitation.

Using direct SMTP connection avoids this issue (at the expense of having a separate app password :( ).

@gauteh
Copy link
Owner

gauteh commented Apr 20, 2021

The message that is passed to gmi is correct presumably? You can check by adding a print(msg) statement at gmailieer.py:835. gmi does not change any of the read bytes before base64-encoding them and passing them to the Gmail API.

@gauteh
Copy link
Owner

gauteh commented Apr 20, 2021

It seems like this issue is not too old: https://issuetracker.google.com/issues/171715824, but old enough that I am worried about it ever getting fixed.. Signed messages that used to work "recently" stopped working.

@wiktor-k
Copy link
Author

Thanks for keeping me in the loop @gauteh and adding a comment there. Much appreciated!

Yep, it may not getting fixed any time soon. Still I'd keep this ticket open (or add an item to Caveats) as a warning to others that may get weird results when using encrypted OpenPGP messages.

@gauteh
Copy link
Owner

gauteh commented Apr 21, 2021 via email

@tomholub
Copy link

The rumors are correct, Gmail API mangles up PGP/MIME messages. I just saw some movement on the issue https://partnerissuetracker.corp.google.com/issues/171715824/resources - fingers crossed.

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

No branches or pull requests

3 participants