Regex not working when trying to remove the signature from incoming mails through the mail handler


i would like to get rid of those annoying mail signatures when our employees comment on a ticket via mail. Our format is sth like this:

The actual comment
*Firstname Lastname* 
<the signature>

I want to chop of everything after the comment, so the firstname / lastname part and everything that follows.

I have build the following RegEx and verified that it is working in a text editor supporting regex:


However, when i configure a new mail handler via "Add a comment before a specified marker or separator in the email body" and using this regex, the signatures are not touched at all. Obviously I also tried it with the slash delimited, changing it to this:


But this does also not work at all.

Could it be the issue that our mails are HTML mails and that the regex is applied before the mail is converted to text so that it can be added as comment?

1 answer

I have been having a similar problem recently and have been using the debug email logs and

to validate the regex in the incoming mail handler.


There seems to be an 80 char limit in the regex though.

We mainly use Outlook but there are a number of iOS and Android phone users that don't match the pattern.



So are you in the same boat as me or did you manage to solve this issue? I tried different variations but gave up eventually.


I currently have 

  • Split Regex: /(\(JIRA\).(w|W)rote)|((O|o)r.*l.(M|m)e.*e.*)|((F|f)rom: jira-marin.*)|(___)/

to try and catch replies to JIRA sent messages

Linux mail appends : On <date> (JIRA) Wrote

Outlook Text emails appends : "Original Message" or "Original message"

Some androids use: From: jira-marin.... (our JIRA email account)

Some people include a line break in their signatures: ____


This regex string complains if I add any more characters to it. The error flashes up briefly when I click save and states that it cannot be more than 255 characters but it actually means 80.




Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,723 views 17 21
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you