zammad icon indicating copy to clipboard operation
zammad copied to clipboard

HTML comments/conditions being rendered from emails

Open Wardrop opened this issue 2 years ago • 9 comments

Infos:

  • Used Zammad version: 5.2.x
  • Installation method (source, package, ..): Source
  • Operating system: OpenSUSE 15.3
  • Database + version: 10.5.15-MariaDB
  • Elasticsearch version: 7.17.5
  • Browser + version: Chrome 103

Expected beha

Zammad should ignore (i.e. strip/remove) conditional comments in HTML of the format <![xxx]>, for example <![if !vml]><![endif]>. These shouldn't be displayed in the article/ticket content.

Actual behavior:

Zammad displays such conditional comments, e.g. <![if !vml]><![endif]>. These are non-standard HTML comments introduced by Microsoft (of course) known as "Downlevel-revealed conditional comments" according to Wikipedia. All browsers ignore these, but Zammad must be escaping the characters as they're displayed in the rendered html output.

We've only observed this since upgrading from Zammad 5.1.x to 5.2.x.

image

Steps to reproduce the behavior:

Injest email into zammad that contains such conditional formatting, typically generating by Outlook/Word.

Wardrop avatar Jul 24 '22 23:07 Wardrop

I wonder if fixing https://github.com/zammad/zammad/issues/4112 has perhaps caused this problem?

Wardrop avatar Jul 24 '22 23:07 Wardrop

Same Problem here after Update to 5.2.x

grafik

Zellular82 avatar Jul 29 '22 07:07 Zellular82

Hi @Wardrop, hi @Zellular82 👋

Could you please provide some test emails (without confidential data)? This would help us to debug the reported behavior.

fliebe92 avatar Jul 29 '22 07:07 fliebe92

Hi fliebe92! 👋 Thanks for your help.

Test.zip

Zellular82 avatar Jul 29 '22 08:07 Zellular82

Hi fliebe92! 👋 Thanks for your help.

Test.zip

Hey @Zellular82, thanks for your test mail. Unfortunately, I am not able to import it. I need to check why...

Maybe you can download the raw mail in Zammad and attach it to this issue.

fliebe92 avatar Jul 29 '22 12:07 fliebe92

Hey Zellular82, thanks for your test mail. Unfortunately, I am not able to import it. I need to check why...

That's because your machines load is different. You need to stress the relevant cores running it to cause 20s+ delays for processing.

MrGeneration avatar Jul 29 '22 12:07 MrGeneration

Try this example email. If I drag and drop this into the mailbox Zammad looks at in Outlook, it reproduces the issue.

Test ticket.zip

It should appear as follows:

image

Wardrop avatar Aug 09 '22 06:08 Wardrop

We're unable to use the msg file variants for several reasons:

  • it forces us to export the messages in question via Outlook in order to receive the eml file we need
  • it works on our machines™️
  • when exporting the message as mentioned above the issue disappears because our clients create a winmail.dat which contains the fuck up (most likely)

So if you wanna help, please provide the original EML. Zammad provides it via the Raw link. Other wise we're unable to further investigate and will be forced to closed the issue without a proper fix.

MrGeneration avatar Aug 09 '22 10:08 MrGeneration

Yeah no worries. See original EML file attached; not sure why I provided the MSG formatted email originally. Hopefully you can replicate the issue with this.

ticket-10212-918.zip

Wardrop avatar Aug 09 '22 22:08 Wardrop