diff --git a/addon/content/pEpMimeEncrypt.js b/addon/content/pEpMimeEncrypt.js index 831568d..c56da6a 100644 --- a/addon/content/pEpMimeEncrypt.js +++ b/addon/content/pEpMimeEncrypt.js @@ -136,8 +136,11 @@ MimeEncrypt.prototype = { this.isDraftOrTemplate); let encryptedMessage = this.controller.synchronise(encryptedPromise); + // The pEp engine assigns a new message ID to the encrypted message, but Thunderbird + // ignores that. So `encryptedMessage.id = message.id;` has no effect here. + // The desired message ID is already in the inner message. + // If it wasn't encrypted after all (ENC_FORMAT_NONE), get the source, otherwise the destination. - encryptedMessage.id = message.id; // Use the same ID, so we can access the message from the cache. let mimePromise = this.controller.cache_mime_encode_message(encryptedMessage.enc_format == ENC_FORMAT_NONE ? 0 : 1, encryptedMessage, true); this.outBuffer = this.controller.synchronise(mimePromise);