Closed Bug 966807 Opened 10 years ago Closed 10 years ago

Add an extra parameter to the url for decryption in MsgHdrToMimeMessage

Categories

(MailNews Core :: Database, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 30.0

People

(Reporter: protz, Assigned: protz)

References

Details

Attachments

(1 file)

Enigmail does something smart, and does not call the gpg utility unless the message that's being streamed through libmime is the one currently displayed. That way, messages streamed by gloda in the background for indexing do not trigger a slow, prompt-triggering decryption process. The catch is, we sometimes want to stream a message in the background _and_ decrypt its contents: there's an API for that in MsgHdrToMimeMessage, and Conversation uses it to figure out useful information about a message, such as: does the message have attachments? (This is also useful to get general metadata about the message when it hasn't been indexed by gloda yet.)

What this patch does is, assuming the MsgHdrToMimeMessage caller specifically asked for it, add an extra parameter to the URL that says "yes, please do decrypt this message, dude, I insist". That way, Enigmail can figure out that really, it should decrypt the message.

Patrick: changing the condition in mimeDecrypt.js to be:

 165         if (this.uri.spec.search(/[\&\?]header=[a-zA-Z0-9]*$/) < 0 &&
 166             this.uri.spec.search(/[\&\?]part=[\.0-9]+/) < 0 &&
 167             !this.uri.spec.search(/[\&\?]examineEncryptedParts=true/)) {

fixes the whole thing.
Attachment #8369258 - Flags: review?(bugmail)
Patrick: line 167 is probably missing a < 0, though!
Comment on attachment 8369258 [details] [diff] [review]
extra-encryption-parameter.patch

> +  // We still some logic to strip encrypted parts, become the other decryption
> +  // backend, SMIME, unconditionally decrypts data. 

This part of the comment is confusing to me.  I'd rephrase.

Note that I de-peer(ed)/etc. myself, so I can only review to the extent you are (able to) defer to me, which is to say as long as we are calling this gloda code, it's okay.
Attachment #8369258 - Flags: review?(bugmail) → review+
I didn't notice you de-peered yourself.

Yes, the comment makes zero sense. I wrote this last night, I probably wasn't very fresh. Thanks for the review! :)
The Enigmail part of this is implemented. As soon as this is committed, we can test it.
OS: Linux → All
Hardware: x86_64 → All
Depends on: 975812
https://hg.mozilla.org/comm-central/rev/ea36dee52123
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 30.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: