Closed Bug 1693332 Opened 3 years ago Closed 2 years ago

want to decrypt OpenPGP e-mails to a folder

Categories

(MailNews Core :: Security: OpenPGP, enhancement)

enhancement

Tracking

(thunderbird_esr91 wontfix)

RESOLVED FIXED
96 Branch
Tracking Status
thunderbird_esr91 --- wontfix

People

(Reporter: firefox.trisected, Assigned: KaiE)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

I tried to decrypt an e-mail to a specific folder in order to send it in plain text

Actual results:

Since enigmail has become "unnecessary" for newer versions of thunderbird, it is no longer possible to decrypt a specific email when using GnuPG instead of TB's own encryption tool.

I have configured thunderbird according to this section of the Wiki
https://wiki.mozilla.org/Thunderbird:OpenPGP:Smartcards

Expected results:

As was possible with Enigmail, a menu option should be displayed to decrypt the mail into a folder.

Component: Untriaged → Security: OpenPGP
Product: Thunderbird → MailNews Core
Type: defect → enhancement
Summary: Unable to decrypt e-mails to a folder using GnuPG → want to decrypt OpenPGP e-mails to a folder
See Also: → 280588, 1627962

We'd like to fix this bug.
I think we should offer both "created a decrypted copy" and "move and decrypt".

We had a look at the patch from the forked project. We think it can be used as a starting point for fixing this bug.

Magnus noted that the move/delete operation probably doesn't work yet, and he is right.

Assignee: nobody → kaie
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

The current implementation allows to process multiple selected messages.

In a first test, if both an encrypted message and a plain message are selected, only the encrypted messages were copied.

How should we implement the operation?

Should we copy/move all selected messages, including unencrypted messages?
What about messages that cannot be decrypted (missing key, insecure encryption, corrupted message)?

We could also discuss whether the menu item should always be enabled/visible.

If a single message is selected, then it's easy to show or hide the menu item based on the encrypted status of the message.
However, if multiple messages are selected, that would be too difficult/expensive to examine.

For multiple messages, I'd always show/enable the menu item.
We could offer the user a choice, to decide what should be done.
The choice could be shown after the user has clicked the destination folder.
The prompt could say "Should the operation to move/copy messages include those messages that are not encrypted, or that cannot be decrypted? (a) copy/move all messages (b) copy/move only messages that are encrypted and that can be decrypted"

Flags: needinfo?(mkmelin+mozilla)

Good questions. I think perhaps it's better to save the "move and decrypt" to the filter action (since the move part = delete, is just a button away after copy succeeded).

I would model it according to the similar items we have:
Copy As Decrypted To > [folderlist flyout]

For multi-selection, seems we should still copy even if some are not encrypted. It would seem the goal is to have an email that can be read by anyone - so that goal is the fulfilled. Say, you have a full folder of messages (some encrypted) that you need to hand over to someone else...

For single selection, please just hide the menu if not encrypted.

In case we cannot decrypt, we should just tell the user that at the end of the operation: "4 of the messages could not be decrypted." - in case that happens. But if there are no problems, we should not prompt.

For insecure encryption and such, I would just do the decryption by any means possible. The resulting message is still insecure in all situation and there are no guarantees about it anymore. Give the user something readable, that's what they asked for.

Flags: needinfo?(mkmelin+mozilla)

Magnus, I agree with most of what you said, but there is one complication.
We don't have code to permanently decrypt S/MIME messages.

We probably should be consistent and implement permanent decrypt for both S/MIME and OpenPGP (both for manual and for filtering).

Note that implementing a "Decrypt OpenPGP messages" could be easily done without touching S/MIME code.
I will have to check how much work permanent S/MIME decryption is.

The existing interfaces to process S/MIME messages aren't fully scriptable. nsICMSDecoder uses a C/C++ callback type.

I think we need to introduce a new interface (IDL), implemented in C++, that allows passing a full message, and which will return the decrypted S/MIME message. Hopefully the amount of new C++ code will be relatively small, calling the existing implementation of nsICMSDecoder, but might have to copy some of the code from mimecryp.cpp and mimecms.cpp

The base patch breaks Exchange message repairing (tests fail).

Blocks: 1743380

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/4dbfe690171b
Implement permanent message decryption and unencrypted copying to a folder. r=mkmelin
https://hg.mozilla.org/comm-central/rev/ef3c9fd0bc35
Add tests for permanent message decryption. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

Comment on attachment 9243827 [details]
Bug 1693332 - Implement permanent message decryption and unencrypted copying to a folder. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #): no
User impact if declined: missing feature from enigmail
Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky): low, new feature

Attachment #9243827 - Flags: approval-comm-beta?
Attachment #9251540 - Flags: approval-comm-beta?
Target Milestone: --- → 96 Branch

Comment on attachment 9243827 [details]
Bug 1693332 - Implement permanent message decryption and unencrypted copying to a folder. r=mkmelin

Comm-central to beta merge is today, so there is no need to uplift to beta.

Attachment #9243827 - Flags: approval-comm-beta?
Attachment #9251540 - Flags: approval-comm-beta?
Blocks: 1589630
See Also: → 1827654
See Also: → 1878053
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: