Closed Bug 1674013 Opened 4 years ago Closed 4 years ago

Unable to fix corrupted MS-Exchange message if opened from a saved local file

Categories

(MailNews Core :: Security: OpenPGP, defect, P2)

Tracking

(thunderbird_esr78 wontfix)

RESOLVED FIXED
84 Branch
Tracking Status
thunderbird_esr78 --- wontfix

People

(Reporter: aleca, Assigned: aleca)

Details

Attachments

(1 file, 1 obsolete file)

If a locally saved corrupted MS-Exchange is opened via File > Open > Saved Message... the console throws this error when clicking on the Repair message button.

JavaScript error: chrome://openpgp/content/modules/fixExchangeMsg.jsm, line 38: TypeError: can't access property "getUriForMsg", hdr.folder is null

A temporary workaround is for the user to copy this message inside a folder in TB (Archive, Inbox, etc.)

Kai, can you reproduce this issue?

Flags: needinfo?(kaie)

The repair assumes a folder, which it then writes back to as well. Since there's no folder for a message opened from file, it can't work (without significant rewriting to do something almost completely different.)

It might be sufficient to introduce a better error message - tell the user we cannot repair files opened this way and instruct to copy.

Flags: needinfo?(kaie)

I can take care of this, so I can also update the test to cover this scenario and prevent the JS error.

Assignee: nobody → alessandro
Severity: -- → N/A
Status: NEW → ASSIGNED
Priority: -- → P2
Attached patch 1674013-broken-exchange.diff (obsolete) — Splinter Review

This patch prevents the repair issue altogether by detecting if the message is inside a folder or not.
If not, we return a notification with the proper information for a successful repair.
No need to run the repair if we already know will fail.

Since there are some strings changes, we should probably not uplift this to 78, which I guess is fine since this is not a super sever issue and we didn't have any report of it so far.

Attachment #9186118 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9186118 [details] [diff] [review]
1674013-broken-exchange.diff

Review of attachment 9186118 [details] [diff] [review]:
-----------------------------------------------------------------

::: mail/locales/en-US/messenger/openpgp/openpgp-frontend.ftl
@@ +34,5 @@
>  openpgp-search-signature-key =
>      .label = Discover…
>  
>  # Don't translate the terms "OpenPGP" and "MS-Exchange"
> +openpgp-broken-exchange-opened = This is an OpenPGP message that was apparently corrupted by MS-Exchange and opened from a local file. Copy the message inside a folder by using the Menu item "Message > Copy to" if you want to try an automatic repair.

We should avoid giving instructions on which menu patch to take, as that could easily change over time.
What we usually do when we know the action can't be done, is we just disable the button. I think that could be reasonable for this case as well.

::: mail/locales/en-US/messenger/openpgp/openpgp.ftl
@@ +576,2 @@
>  failed-decrypt = Error - decryption failed
> +fix-broken-exchange-msg-failed = Unable to repair the selected message.

Usually l10n key should be updated, but I guess this just improves the language and doesn't change the message.

But "selected message" is a bit weird. How about "Could not repair this message." or "Repairing this message did not work."
Attachment #9186118 - Flags: review?(mkmelin+mozilla)

What about "Unable to repair this message."?
I think it's better to keep a simple present verb instead of Could or Repairing...did not.

We should avoid giving instructions on which menu patch to take, as that could easily change over time.
What we usually do when we know the action can't be done, is we just disable the button. I think that could be reasonable for this case as well.

Sure, but I think we should let the user know why we can't repair it and avoid a dead-end interaction.
What about this?
"This is an OpenPGP message that was apparently corrupted by MS-Exchange and it can't be repaired because it was opened from a local file. Copy the message into a mail folder to try an automatic repair."

Flags: needinfo?(mkmelin+mozilla)
Attachment #9186118 - Attachment is obsolete: true
Flags: needinfo?(mkmelin+mozilla)
Attachment #9187011 - Flags: review?(mkmelin+mozilla)
Attachment #9187011 - Flags: review?(mkmelin+mozilla) → review+
Target Milestone: --- → 84 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/90eb59ff31f2
Improve message feedback when trying to fix corrupted MS-Exchange of opened local files. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: