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

Hello,

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:

\*.+\s.+\*

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:

/\*.+\s.+\*/

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

This widget could not be displayed.

I have been having a similar problem recently and have been using the debug email logs and http://regexr.com/

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.

yep, 

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
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

195 views 1 3
Join discussion

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