Email signature images are attached to incident

hatazhix
Mega Expert

Hello,

I am using Servicenow Geneva version and I have noticed that when vendor has signature with images like facebook, linkedIn and etc. Then these images will be attached to this specific incident that vendor have replied. This issue was in previous versions and there was some solutions that made note about image size or something similar, but I am looking for valid and working solution.

1 ACCEPTED SOLUTION

Hi Hai,



I know the pain. I had been looking for a perfect solution for months until I found incidents with over 300 social media icons in our instance. Unfortunately, there is not much you can do without analyzing the attachments and best option depends on what exactly want to achieve. File type and size is something that can be implemented easily and works pretty nice. Nevertheless, in our case it was not enough as images in signatures are sometimes around the size of other images(e.g. really small screenshots). I decided to implement more sophisticated solution that may still be far from perfect but worked like a charm.



If any of the below tests fails, attachment is moved to the ticket as usually. Otherwise, attachment stays intact under sys_email record.


1. Check file type(image) and size(<4096 bytes).


2. Calculate hash


3. Compare list of blacklisted hashes. The list consists of hashes of official images used by our company and our vendors.


4. Compare hashes of already attached images of the same size and type to avoid duplicates.



Magic happens in one business rule on sys_attachment table.



I cannot share the script at the moment but let me know if you would like to know more.



// Damian


View solution in original post

14 REPLIES 14

The BR is on sys_attachment table and uses "Size Bytes less than 4096" and "Content TypeSTARTS WITH image". You can set it in the condition builder.


Hello,



I got it working thank you!


I'm trying to add on to this concept to strip out the signatures by using the attribute from the image itself in the email.



I looked at the source on a reply to an email, and I see this: (below it is a screenshot of my actual signature)



<div><p><b><span style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;color:#1F497D'>David Self </span></b><span style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;color:#1F497D'>|ServiceNow Lead Engineer|</span><span style='font-size:10.0pt;font-family:Wingdings;color:#C00000'> ¤</span><span style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;color:black'> Target|(m) 763.670.7057<o:p></o:p></span></p><p><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><img width=461 height=58 style='width:4.8in;height:.6in' id="_x0000_i1032" src="cid:image001.jpg@01D2036B.0E938AA0" alt=Signature><o:p></o:p></span></p></div>



signature.jpg


Notice the bold text, we could use that to say we don't want that image converted to an attachment. I'm trying to figure out if I would do this at the inbound action, or if perhaps I should do it on the sys_attachment table.



Right now I'm leaning toward an inbound action simply targeting that attribute, then stripping that whole image tag out and leaving everything before and after it to be processed like normal.



Here at Target, people have all kinds of different signatures and icons scattered throughout their signatures. It's filling our sys_attachment table.


Hello,



that is very good note. alt=Signature could be the key to resolve this. I think i will try the same. Thank you very much!


Hello,



I gave it a though that figured out that there could be some important small pictures about screenshots attached between texts so there is no way to filter out signatures because they are also small pictures. And so if you filter out signatures then it will filter out in some cases, important small screenshots. This alt=Signature is a part "Signature" is name of that and it could be anything. In my tests it was IMG0001, IMG0002 and so on. I can't really determine which is signature.



If you have any other idea then I would like to hear it.