4 Replies Latest reply on Jun 5, 2018 5:21 AM by fluffy midnight

    RegEx to cut out signature in ticket.



      WHD convert HTML emails to text when logging calls, so (image sig1.png) a nice HTML signature turns into a huge mess.. (Image sig2.png)


      Can anyone assist me with writing an E-Mail Content Regular-Expression Filter?

        • Re: RegEx to cut out signature in ticket.

          The RFC for email signatures is to prefix the signature with "-- " (dash dash space). If you're using this, WHD will filter out the signature automatically. If there's not a standard expression that WHD can lock on to, it won't be able to filter the signature every time.

          • Re: RegEx to cut out signature in ticket.

            I hate to resurrect an old thread, but this is the only one I've found on the subject.


            I have tried using the Email Content RegEx filter:

            (?s)[\r\n]{1,2}-- {1,2}[\r\n]{1,2}.*$

            but it does not strip out signatures when using the -- (dash dash space) in the email. It works in the Test sandbox in the Email Options section of Setup, but not in practice with actual email.



            I can strip out images from the email using the Email Attachment RegEx filter:


            but it strips out ALL .png files, and .png happens to be the default file type that the Windows Snipping Tool saves in, so it also strips out all images we might want to KEEP when we use that filter. Also, because the content filter isn't working, even if I filter out .png files, I end up with 8+ image tags at the end of the ticket (like below).














            Has anyone had any success with this?

            • Re: RegEx to cut out signature in ticket.
              fluffy midnight

              Hi doughall2015,


              A separate tool to filter your emails coming into that mailbox would be required to achieve what you are wanting, you could technically achieve this through Powershell if you're that bothered by the signature.


              As welikedustybtr has said, you can use the RegEx filter to strip out a good majority of a signature if it meets the specified criteria, however it cannot remove <image> tags and some signatures will certainly bypass this.


              Additionally, the RegEx filter can remove data which is not a signature if the email is structured in such a way, hence my recommendation on using another tool to accomplish this.