Details
-
Bug
-
Resolution: Fixed
-
Low
-
5.0.7
-
5
-
Description
NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.
Using something like GreenHopper or the SOAP API, an issue can be created or edited to have a newline (i.e. "\n") character in the issue summary.
This causes problems with plain text and HTML email notifications because the newline is not stripped out. Therefore the "Subject:" email header line will be split in such a way that the data section will start prematurely.
Here is a script to create a sample issue:
#!/usr/bin/env ruby require 'rubygems' gem 'soap4r' require 'soap/wsdlDriver' soap = SOAP::WSDLDriverFactory.new('http://localhost:8080/rpc/soap/jirasoapservice-v2?wsdl').create_rpc_driver token = soap.login('admin', 'password') issue_map = { :type => "1", :project => "TST", :summary => "This test issue has a newline\nafter the first occurrence of the word 'newline'", :description => "This is the description.", :assignee => "admin" }; issue = soap.createIssue(token, issue_map);
The resulting email has the subject "[JIRA] Created: (TST-4) This test issue has a newline" and the body looks like:
after the first occurrence of the word 'newline' MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk Auto-Submitted: auto-generated X-JIRA-FingerPrint: dee9d5d26e4e05c908d4fd9475e805a2 <html> <head> <!-- You are receiving this email because you have chosen HTML as your email preference. ...
This is because the headers contain the following:
From: "Admin (JIRA)" <mknight@atlassian.com> To: mknight@atlassian.com Message-ID: <2135917781.11.1295508323968.JavaMail.mknight@kitt.sydney.atlassian.com> Subject: [JIRA] Created: (TST-4) This test issue has a newline after the first occurrence of the word 'newline' MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk Auto-Submitted: auto-generated X-JIRA-FingerPrint: dee9d5d26e4e05c908d4fd9475e805a2 <html> <head> <!-- You are receiving this email because you have chosen HTML as your email preference. ...
The example here shows HTML emails, which are significantly affected because the HTML will not be rendered. It will just look like a plain text email full of mark-up.
Attachments
Issue Links
- is duplicated by
-
JRASERVER-28663 When an issue's summary has two newlines in it, JIRA sends out invalid mime emails
- Closed
-
JRASERVER-26980 Issue summary allows new-line characters when creating issue via SOAP API
- Closed
- relates to
-
JRACLOUD-23494 Issues can have a newline in the summary, which results in malformed email notifications
- Closed
-
JRASERVER-30055 Issue update emails are garbled for particular issues
- Closed
-
JRADEV-12924 Loading...