Details
-
Bug
-
Resolution: Fixed
-
Low
-
3.2.2
-
3.02
-
Description
This issue relates to JRA-5238. When replying to the html version of jira emails from outlook, outlook adds a ruled line between messages. Below is the code that I currently use to test for the different outlook reply email formats (using java 1.4's regex matching).
private static final Pattern OUTLOOK_HTML_COMMENT = Pattern.compile("\\s\\r\\n+_
{33,}\\s\\r\\n+From:.*", Pattern.DOTALL);
private static final Pattern OUTLOOK_TEXT_COMMENT = Pattern.compile("\\s\\r\\n
s+(Original Message|Ursprüngliche Nachricht|Original Message Follows)
s++\\r\\n+From:.*", Pattern.DOTALL);
....
public String stripQuotedLines(String body)
{
....
String nonQuotedMsg = result.toString();
Matcher matcher = OUTLOOK_HTML_COMMENT.matcher(nonQuotedMsg);
if (matcher.find()) nonQuotedMsg = matcher.replaceFirst("");
matcher = OUTLOOK_TEXT_COMMENT.matcher(nonQuotedMsg);
if (matcher.find()) nonQuotedMsg = matcher.replaceFirst("");
return nonQuotedMsg;
}
In fact, IMHO, the entire code of the stripQuotedLines() method could very easily be refactored using a few regular expressions - it would make the code much tighter.
Attachments
Issue Links
- is related to
-
JRASERVER-7465 Let NonQuotedCommentHandler use pluggable regular expressions to separate quoated message part.
- Closed
- relates to
-
JRASERVER-5238 Improve CreateIssueHandler to handle Outlook messages
- Closed