whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: bug fixes
Date Tue, 01 May 2018 21:12:39 GMT
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 <rubys@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.

Mime
View raw message