Skip to content

Commit

Permalink
Split on an exact \r\n\r\n sequence if it exists
Browse files Browse the repository at this point in the history
This has been broken since 17783f8
  • Loading branch information
ConradIrwin committed Jan 28, 2013
1 parent a944f31 commit dcc4772
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mail/message.rb
Expand Up @@ -1889,7 +1889,7 @@ def text?
# Additionally, I allow for the case where someone might have put whitespace
# on the "gap line"
def parse_message
header_part, body_part = raw_source.lstrip.split(/#{CRLF}#{WSP}*#{CRLF}(?!#{WSP})/m, 2)
header_part, body_part = raw_source.lstrip.split(/#{CRLF}#{CRLF}|#{CRLF}#{WSP}*#{CRLF}(?!#{WSP})/m, 2)
self.header = header_part
self.body = body_part
end
Expand Down
@@ -0,0 +1,27 @@
Received: from tools02.corp.linkedin.com (172.18.46.250) by
esv4-cas02.linkedin.biz (172.18.46.142) with Microsoft SMTP Server id
14.1.355.2; Fri, 25 Jan 2013 14:32:09 -0800
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
From: CRT Notifications <crt-notifications-noreply@linkedin.com>
To: Example <example@example.com>
Subject: Reverting back 46964b45b3a2d50c8c8777128a5d8f179a121b77,
Please refer to
https://mp-trunkdev-hudson.corp.linkedin.com/job/MP_TRUNKDEV_POSTCOMMIT/969/
Message-ID: <82077049-8e7b-4f95-90e8-84da7b2f9514@ESV4-CAS02.linkedin.biz>
Return-Path: crt-notifications-noreply@linkedin.com
Date: Fri, 25 Jan 2013 14:32:09 -0800
X-MS-Exchange-Organization-AuthSource: esv4-cas02.linkedin.biz
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 0a
X-Originating-IP: [172.18.46.250]
MIME-Version: 1.0

Hello example,

Reverted back 46964b45b3a2d50c8c8777128a5d8f179a121b77, Please refer to https://mp-trunkdev-hudson.corp.linkedin.com/job/MP_TRUNKDEV_POSTCOMMIT/969/
The replacement revision is 127ca8c104fd96ca35edeb09dd4c706d792cb2fc.

Please make sure that the issue is fixed when you recommit your changes.

Thanks.
11 changes: 11 additions & 0 deletions spec/mail/example_emails_spec.rb
Expand Up @@ -275,6 +275,17 @@

end

describe "raw_email_starting_with_space.eml" do

before(:each) do
@message = Mail::Message.new(File.read(fixture('emails', 'plain_emails', 'raw_email_starting_with_space.eml')))
end

it "should parse the body" do
@message.body.should =~ /Reverted/
end
end

describe "sig_only_email.eml" do
before(:each) do
@message = Mail.read(fixture('emails', 'mime_emails', 'sig_only_email.eml'))
Expand Down

0 comments on commit dcc4772

Please sign in to comment.