You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2018/05/01 21:12:39 UTC

[whimsy] branch master updated: bug fixes

This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c541c7  bug fixes
4c541c7 is described below

commit 4c541c724f06ac6157c79880001bb51cd3b5d4a1
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Tue May 1 17:12:28 2018 -0400

    bug fixes
---
 www/secretary/workbench/models/message.rb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/www/secretary/workbench/models/message.rb b/www/secretary/workbench/models/message.rb
index 708c66a..bec6eb1 100644
--- a/www/secretary/workbench/models/message.rb
+++ b/www/secretary/workbench/models/message.rb
@@ -315,18 +315,19 @@ class Message
   # parse a message, returning headers
   #
   def self.parse(message)
-    mail = Mail.read_from_string(message)
-
     # cleanup broken header separators.  Avoid copying the possibly large body
     # unless a fixup is needed.
     message.sub! /\AFrom .*\r?\n/i, '' if message =~ /^\AFrom /i
-    headers = mail[/(.*?)\r?\n\r?\n/m, 1]
+    headers = message[/(.*?)\r?\n\r?\n/m, 1]
     if headers.include? "\n" and not headers.include? "\r\n"
       headers, body = mail.split(/\r?\n\r?\n/, 2)
       headers.gsub("\n", "\r\n")
       message = "#{headers}\r\n\r\n#{body}"
     end
 
+    # parse cleaned up message
+    mail = Mail.read_from_string(message)
+
     # parse from address
     begin
       from = liberal_email_parser(mail[:from].value).display_name

-- 
To stop receiving notification emails like this one, please contact
rubys@apache.org.