Avoiding signature images

SNOW User8
Giga Guru

Hi All,

How to avoid signature images from being attached with incident, regardless of image sizes/types?

I am looking for the best solution, referred few threads & thought of doing that by calculating the hash values of signature images to ignore & maintain that in a table. But I don't know how to calculate the hash value of signature images alone & maintain that in a table.

Refer: Is there a way to determine the hash value of an incoming attachment to SN? In general, trying to av...

Kindly help me.

Thanks,

Anna.

7 REPLIES 7

I haven't noticed any performance issue, but then again I haven't tested on a production instance. 

 

Used:

//used on on before business rule on sys_attachment. Current relates to the current object. 

var newAttachment = GlideStringUtil.base64Encode(new GlideSysAttachment().getBytes(current));

//found is an attachment key found in sys_attachment based on our blacklisted attachment table

var invAttachment = GlideStringUtil.base64Encode(new GlideSysAttachment().getBytes(found));

	if(newAttachment == invAttachment) {
					gs.log("We blacklisted something");
					current.setAbortAction(true);
				}

 

Did you use something similiar, and what were your performance issues? 


Best regards,
Sebastian Laursen

Josh Petrick
Kilo Sage

My company implemented the Email Image filtering properties and set the glide.email.inbound.image_sys_attachment.filter.minimum_bytes property to 5000.  It isn't perfect, but it has eliminated the majority of the junk signature images, and it's been over a year and no one has complained that it blocked a legitimate attachment.

Dub Myers
ServiceNow Employee
ServiceNow Employee

Also, as of New York, a SHA256 is calculated and put into sys_attachment.hash field and this is something you can use.

See "Attachments are assigned unique identifiers" in the New York release notes.

Additionally if an email arrives with an attachment (image or otherwise),its hash is compared to other attachments on the target record that have a hash. If the identical content already exists on the target record, the attachment is not moved to the target record, but remains on the sys_email record.