How to exclude signature attachments from tickets

rick_angel
Kilo Explorer

Often users will reply to ticket related email threads.   If the users have attachments, pictures, etc embedded in their signatures these are replicated with each email reply causing unnecessary clutter and additional size.   Is there a way identify that an attachment is part of an email signature and exclude the attachment from the ticket content?   Thanks.

3 REPLIES 3

Thijs Daemen
Mega Guru

Hi Rick,



Have a look at this thread Strip Email Attachments Inbound Action. There are some solutions in there that have worked well for others.



Kind regards,



Thijs


giriprasad9
Tera Expert

Hi Rick,



You can write a business rule on "Attachment" table to skip the signature attachment creation.



1. Goto "sys_attachment" table and identify the signature attachments and then note down there "size_bytes" and "size_compressed" values of it.



find_real_file.png



2. Create a Business Rule on Attachment table


Name : Skip Attachments


When : Before


Insert: true



Script :


function onBefore(current, previous) {


    //This function will be automatically called when this rule is processed.


      if(current.size_bytes==5729 && current.size_compressed==5609){


              current.setAbortAction(true);      


      }


}



If you want you can extend condition with current.content_type or some other fields.



-Giri


I created a Business Rule to do this, similar to your example.   It works when I go into a Request/Incident and manually add an attachment that is too small of an image (image/png < 8000 bytes).   However, when the attachments are part of an email processed by an Inbound Action, they still get attached.



It seems like the rule isn't running when the system creates attachments from emails.   Any idea why?