GpgOL: Attached mails are empty if attached mail has encrypted attachments or is in text format and encrypted or signed
Closed, ResolvedPublic

Assigned To
Authored By
timegrid
Sep 5 2025, 5:25 PM

Description

When mails are sent via attachment, the attachment is displayed empty in both preview and opened window if

  • the attached mail is written in text-only format and is signed and/or encrypted
  • the attached mail has encrypted attachments

I have generated mails with all permutations of outlook formats (html, rich, text) * (un)signed * (un)encrypted and sent them via attachment in various ways. Sending the attachments signed and/or encrypted does not matter, neither if it's a single or multiple attachements. In all cases the empty display in the preview / opened window is the same. This behaviour can be seen e.g. in the following attachments of the mail Ted:INBOX/Anhänge/attached unsigned unencrypted: all mailformats (15:07):

  • TEXT signed unencrypted
  • TEXT unsigned encrypted
  • TEXT signed encrypted

Additionally attaching mails with encrypted attachments (does not matter if signed or not) leads to the same behaviour, which can be seen in the following attachments of the mail Ted:INBOX/Anhänge/attached unsingned unencrypted: all attachment mails (16:30):

  • attached unsigned encrypted: all mailformats
  • attached signed encrypted: all mailformats

Notes:

  • RICH/HTML and encrypted attachements are displayed with their own openpgp-encrypted-message.asc attachment, which in turn can be opened fine (although it's displayed via Kleopatra and only as text not html). Not sure, if this is the expected behaviour

Details

Version
vsd-3.3.2 @ win10

Event Timeline

Here are the messages and logs, when trying to open them:

mailattached unsigned unencrypted_ TEXT signed encryptedattached unsingned unencrypted_ all attachment mails
attachmentTEXT signed encryptedattached signed encrypted: all mailformats
msg
eml
log

Looks like there is a rights problem modifying the body of those mails
Every time when we try to modify the HTMLBODY or BODY property we fail with MAPI_E_NO_ACCESS.
The attached mails in those tests where ms-tnef formated (winmail.dat)

omhelp.cpp:lookup_oom_dispid:160 wchar_t alloc 00000155d9abfe80:HTMLBody
07:35:08/5284/oomhelp.cpp:put_oom_string:674 wchar_t alloc 00000155ccf77710:<html><head></head><body><table border="0" width="100%" cellspacing="1" cellpadding="1" bgcolor="#0069cc"><tr><td bgcolor="#0080ff"><p><span style="font-weight:600; background-color:#0080ff;"><center>OpenPGP Nachricht</center><span></p></td></tr><tr><td bgcolor="#e0f0ff"><center><br/>Bitte warten Sie w�hrend die Nachricht entschl�sselt / gepr�ft wird...</td></tr></table></body></html>
07:35:08/5284/oomhelp.cpp:put_oom_string: Putting 'HTMLBody' failed: 0x80020009
07:35:08/5284/DBG_OOM/oomhelp.cpp:dump_excepinfo: Exception: 
              wCode: 0x1000
              wReserved: 0x0
              source: Microsoft Outlook
              desc: Sie besitzen nicht die erforderliche Berechtigung, um diesen Vorgang auszuf�hren.
              help: null
              helpCtx: 0x0
              deferredFill: 0000000000000000
              scode: 0x80070005
07:35:08/5284/TRACE/oomhelp.cpp:put_oom_string:699: return
07:35:08/5284/ERROR/mail.cpp:decryptVerify_o: Failed to modify html body of item.

07:35:08/5284/oomhelp.cpp:put_oom_string: Putting 'HTMLBody' failed: 0x80020009
07:35:08/5284/DBG_OOM/oomhelp.cpp:dump_excepinfo: Exception: 
              wCode: 0x1000
              wReserved: 0x0
              source: Microsoft Outlook
              desc: Sie besitzen nicht die erforderliche Berechtigung, um diesen Vorgang auszuf�hren.
              help: null
              helpCtx: 0x0
              deferredFill: 0000000000000000
              scode: 0x80070005
07:35:08/5284/TRACE/oomhelp.cpp:put_oom_string:699: return
07:35:08/5284/ERROR/mail.cpp:decryptVerify_o: Failed to modify html body of item.

07:35:39/5284/oomhelp.cpp:put_oom_string: Putting 'HTMLBody' failed: 0x80020009
07:35:39/5284/DBG_OOM/oomhelp.cpp:dump_excepinfo: Exception: 
              wCode: 0x1000
              wReserved: 0x0
              source: Microsoft Outlook
              desc: Sie besitzen nicht die erforderliche Berechtigung, um diesen Vorgang auszuf�hren.
              help: null
              helpCtx: 0x0
              deferredFill: 0000000000000000
              scode: 0x80070005
07:35:39/5284/TRACE/oomhelp.cpp:put_oom_string:699: return
07:35:39/5284/TRACE/mail.cpp:updateBody_o:1771
07:35:39/5284/ERROR/mail.cpp:updateBody_o: Failed to modify html body of item.

7:35:39/5284/oomhelp.cpp:put_oom_string: Putting 'Body' failed: 0x80020009
07:35:39/5284/DBG_OOM/oomhelp.cpp:dump_excepinfo: Exception: 
              wCode: 0x1000
              wReserved: 0x0
              source: Microsoft Outlook
              desc: Das Objekt unterst�tzt diese Methode nicht.
              help: null
              helpCtx: 0x0
              deferredFill: 0000000000000000
              scode: 0x80020009
07:35:39/5284/TRACE/oomhelp.cpp:put_oom_string:699: return
07:35:39/5284/TRACE/mail.cpp:updateBody_o:1905
07:35:39/5284/ERROR/mail.cpp:updateBody_o: Failed to modify body of item.
mmontkowski mentioned this in Unknown Object (Maniphest Task).Sep 29 2025, 9:21 AM
ebo moved this task from Backlog to WIP on the vsd34 board.
ebo triaged this task as High priority.Oct 9 2025, 10:35 AM
ebo moved this task from WIP to Triage on the gpgol board.
mmontkowski changed the task status from Open to Testing.Tue, Jul 14, 3:58 PM
mmontkowski moved this task from Backlog to WIP on the vsd34 board.

Ggf mit T7858 gefixed ?

timegrid changed the task status from Testing to Open.Thu, Jul 16, 11:52 AM
timegrid moved this task from QA to WIP on the gpd5x board.

No change in gpg4win-5.1.0-beta658 / gpgol-2.7.3-beta11_dd853c7 @ win11:

  • attached unsigned unencrypted: all mailformats
    • TEXT signed unencrypted
    • TEXT unsigned encrypted
    • TEXT signed encrypted
  • attached unsigned unencrypted: all attachment mails
    • attached unsigned encrypted: all mailformats
    • attached signed encrypted: all mailformats

I'm retesting with newly created mails, maybe something changed

Note: The fix will only apply to new mails, so I consider the old mails invalid now.

I recreated

  • mails, with mail attachments (all possible combinations)
  • nested mails, with the above mail attached

The original issue described in here is resolved in
gpg4win-5.1.0-beta658 / gpgol-2.7.3-beta11_dd853c7 @ win11:

  • the attachments are always displayed in the same way, independent of the outer mail being signed and/or encrypted.
  • it's always possible to save the mail attachment to desktop and open it in outlook (with correct content and security level)

Examples for the original cases in this ticket (new mails in ted:INBOX/Anhänge):

  • attached unsigned unencrypted: all mailformats -> attached unsigned unencrypted: oppgp
    • TEXT signed unencrypted -> 0221 oppgp sign text files
    • TEXT unsigned encrypted -> 0121 oppgp encr text files
    • TEXT signed encrypted -> 0021 oppgp both text files
  • attached unsigned unencrypted: all attachment mails -> nested unsigned unencrypted: attached unsigned unencrypted: oppgp
    • attached unsigned encrypted: all mailformats -> attached unsigned unencrypted: oppgp
    • attached signed encrypted: all mailformats -> attached signed encrypted: oppgp

There are other issues for mail attachments now, which will result in new tickets:

  • display of "Version: 1" as attachment
  • smime mails are now associated with outlook smime and can't be directly opened
  • attached pgp mails are often opened in kleo, which might be fine (signature/encryption displayed correct, file attachments accessible)
  • when opened directly in outlook:
    • signed text attached mails have encoding issues (e.g. 0220 oppgp sign text noatt)
    • attached pgp encrypted mails don't display the text body (e.g. 0021 oppgp both text files)
    • singed pgp encrypted mails don't display attachments (e.g. 0201 oppgp sign html files)
  • nested signed mail attachments do not trigger the verification (signature is an attachment)
timegrid edited projects, added gpd5x (gpd-5.1.0); removed gpd5x.