Page MenuHome GnuPG

Attachments vanish from forward encrypted message
Open, NormalPublic

Description

If you forward an encrypted Email the attachments are no longer displayed in the original email.
To recreate :

Press Forward => you see the new mail with the original message and the attachments
Press Cancel => Back to the original with no more attachments
Press Forward => you see the new mail with the original WITHOUT any the attachments.

Deselect email and select again (email gets decrypted again) attachments are back.

If you open the original email in a window of its own you 'll see that the attachments fanish from it during the open-/ceating of the forwarded message.

Event Timeline

mmontkowski created this object in space Restricted Space.
mmontkowski created this object with edit policy "g10code (Project)".

This is caused by "Mail::removeOurAttachments_o()" to avoid that when you forward an encrypted mail, that the decrypted attachments are also attached as well as the original mail. Same goes for send again.

/* Remove our attachments for example if we are a forward of an
   encrypted message or a previously encrypted draft we do not
   want to have the gpgol_mime_structure duplicated. */
removeOurAttachments_o ();

A fix for this would likely be to call Mail::add_attachments_o on the mail that was forwarded after the mail that is forwarded has been created.

aheinecke renamed this task from Attachments fanish from forward encrypted message to Attachments vanish from forward encrypted message.Aug 23 2024, 12:47 PM
werner triaged this task as Normal priority.Aug 23 2024, 2:32 PM
werner added projects: Feature Request, Restricted Project.
werner shifted this object from the Restricted Space space to the S1 Public space.
werner added a subscriber: werner.
werner mentioned this in Unknown Object (Phriction Wiki Document).Sep 26 2024, 3:35 PM

Well I finally did some more tracing and removeOurAttachments_o is not called when the attachments vanish.

The call of gpgol_mailitem_revert seams to do it with the invoke_oom_method(..."Delete") call in line 377.
If I disable that call the attachment stays in the original mail and no duplicate attachments in the forwarded mails either

Appplication flow (as reminder)
application-events ItemLoad => do_in_ui_thread_async (INVALIDATE_LAST_MAIL)
mailitem_events ProperyChange SendusingAccout
mailitem_events Write => do_in_ui_thread_async(REVERT_MAIL) (line 793)
mailitem_events BeforeAttachmentSave
mailitem_events BeforeCheckNames
mailitem_events AfterWrite
mailitem_events fc95
mailitem_events Forward =...=> Mail::clearLastMail();
INVALIDATE_LAST_MAIL => Mail::clearLastMail();
REVERT_MAIL => invoke_oom_method("Save") => mailitem_events Ivoke "Write" => Mail::revert_o => gpgol_mailitem_revert

mmontkowski moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Thu, Mar 20, 2:12 PM