Notifications

2619 views

Description

When the system property glide.email.inbound.convert_html_inline_attachment_reference is set to false, inbound email processing does not update the email's HTML data to reflect the stored location of the attachment in the sys_attachment table. As a result,

  • Inline images do not appear in email display in the activity formatter
  • Inline images do not appear when the email is viewed in the email HTML preview.
  • When appending email.body_htm in inbound actions between [code] tags, the images are missing.

Release or Environment

Eureka and later versions

Cause

The glide.email.inbound.convert_html_inline_attachment_reference was set to false.

Because the default value is true, and setting it to false to breaks user interface functionality for users who might expect this to work, it is unusual to set this property to 'false' without a good reason.

One cause of this issue due to the ServiceNow Instance Hardening recommendations. In the section on Email Security, there is a section suggesting setting the property to false to avoid the possibility displaying an image that is somehow malicious. The consequence of following that security recommendation is that you trade off the ability to see the images displayed within the email when rendered.

Resolution

Check first within your organization whether this is set false because of security concerns.

If there are no security concerns, set glide.email.inbound.convert_html_inline_attachment_reference to true so that future emails received will contain the necessary HTML url to reference the image. Changing the property does not update emails already received. The new value affects only inbound emails received after changing the property.

property glide.email.inbound.convert_html_inline_attachment_references set to true


Additional Information

The property glide.email.inbound.convert_html_inline_attachment_reference was introduced in Eureka.

When in MIME format, any inline image referenced in the HTML message body points to a location inside the MIME data. This HTML reference appears as "<img src=cid:<identifier>” where the identifier value is a “pointer” to another location inside the MIME data as read from the server.

ServiceNow does not store mail in the original MIME format. Once mail is stored in the instance, the mail contents are now stored in sys_email and sys_attachment records. The HTML of the email still references the image as if it were in the MIME data. This means it points to something that cannot find, so the browser cannot display it. When the property is 'true', ServiceNow modifies the sys_email's HTML img tags when processing the inbound email to ensure that inline image references will point to the new in-instance storage location in the sys_attachment table. This process converts img tags that look like "<img src=cid:<identifer>” into tags that look like "<img src=http://<instance>?sys_id=<sys_id></img>”. By doing so, the HTML is translated to reflect its new storage location in ServiceNow's attachment table. When the email is viewed in email preview in the browser, the inline image is visible because the browser can correctly access the image via the correct URL.

Regardless of the property value, the image itself is always stored in the sys_attachment table. It is only the HTML reference to the img tag that this property affects.

Article Information

Last Updated:2020-08-13 14:17:22
Published:2020-08-13