sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 99e62d554493df30ee063b2bafb664caaf2263ab
parent fb1f9e01c6985356058190bb8cf16b9bceb0adcc
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Fri,  4 Sep 2009 11:52:14 -0400

Merge branch 'master' into next

Conflicts:
	lib/sup/message.rb

Diffstat:
M lib/sup/message.rb | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/lib/sup/message.rb b/lib/sup/message.rb
@@ -434,20 +434,24 @@ private
 
       chunks
     elsif m.header.content_type == "message/rfc822"
-      payload = RMail::Parser.read(m.body)
-      from = payload.header.from.first ? payload.header.from.first.format : ""
-      to = payload.header.to.map { |p| p.format }.join(", ")
-      cc = payload.header.cc.map { |p| p.format }.join(", ")
-      subj = payload.header.subject
-      subj = subj ? Message.normalize_subj(payload.header.subject.gsub(/\s+/, " ").gsub(/\s+$/, "")) : subj
-      if Rfc2047.is_encoded? subj
-        subj = Rfc2047.decode_to $encoding, subj
+      if m.body
+        payload = RMail::Parser.read(m.body)
+        from = payload.header.from.first ? payload.header.from.first.format : ""
+        to = payload.header.to.map { |p| p.format }.join(", ")
+        cc = payload.header.cc.map { |p| p.format }.join(", ")
+        subj = payload.header.subject
+        subj = subj ? Message.normalize_subj(payload.header.subject.gsub(/\s+/, " ").gsub(/\s+$/, "")) : subj
+        if Rfc2047.is_encoded? subj
+          subj = Rfc2047.decode_to $encoding, subj
+        end
+        msgdate = payload.header.date
+        from_person = from ? Person.from_address(from) : nil
+        to_people = to ? Person.from_address_list(to) : nil
+        cc_people = cc ? Person.from_address_list(cc) : nil
+        [Chunk::EnclosedMessage.new(from_person, to_people, cc_people, msgdate, subj)] + message_to_chunks(payload, encrypted)
+      else
+        [Chunk::EnclosedMessage.new(nil, "")]
       end
-      msgdate = payload.header.date
-      from_person = from ? Person.from_address(from) : nil
-      to_people = to ? Person.from_address_list(to) : nil
-      cc_people = cc ? Person.from_address_list(cc) : nil
-      [Chunk::EnclosedMessage.new(from_person, to_people, cc_people, msgdate, subj)] + message_to_chunks(payload, encrypted)
     else
       filename =
         ## first, paw through the headers looking for a filename