Strip Email Attachments Inbound Action

wmahmud1
Kilo Explorer

Hello -

I am trying to strip all attachments that get picked up by ServiceNow under 5000 bytes so we can avoid unecessary attachments of users signatures to records.

I have looked at some examples posted already and setup something similar.   My issue is, the business rule on the sys_attachment table seems to run as I can see the script log showing the name of the file being aborted, but the email log itself, is not capturing the target (remains as empty) and not communicating back to the record.   If i turn off this busienss rule, it works fine again.

Any ideas what the issue may be?

(see attached business rule detail)

28 REPLIES 28

What I did to get around that is to add specific OR queries to the condition as I found the signature images are all exactly the same size and I have been able to specifically remove thos, see below for full condition string:

 

parseInt(current.size_bytes) <= 5000 || parseInt(current.size_bytes) == 27591 || parseInt(current.size_bytes) == 29272 || parseInt(current.size_bytes) == 29251

 

What I also found was that the size was the 'size on disk', not the 'file size' when you right-click and look at the properties of the file to gain the exact size.

 

Hope this helps.

Carl -- this worked great! thank you for this

You're welcome - glad it worked for you, I love this community!

Edward Rosario
Mega Sage
Mega Sage

 

This is a way to filter out certain images from being imported into SN? for example, if a user emails #itsm. and they have the aarons logo in their signature, that gets imported into the incident as well as linkedin, etc...

Email image filtering properties:

https://docs.servicenow.com/bundle/madrid-servicenow-platform/page/administer/notification/concept/e...

In the filter navigator navigate to: sys_properties.list

search glide.email.inbound.image_sys_attachment.filter.minimum_bytes : In this property you can use to specify the minimum size of attachments which you can definitely use to filter out those pesky linkedin and twitter logo's and most other signature images depending on how ostentatious the signature it.

I set this value to 5000

 

 

glide.email.inbound.image_sys_attachment.filter.action : you can use to filter images and either attach to the record, attach to the email or not attach at all.