sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit d01ea7605e923dd069d2ba942634bc1a14feafc3
parent ef5094787d0bf52a0225313eda11228439937bd8
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Sat, 26 Dec 2009 10:04:57 -0800

Merge branch 'list-post-improvements' into next

Diffstat:
M lib/sup/message.rb | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lib/sup/message.rb b/lib/sup/message.rb
@@ -114,12 +114,16 @@ class Message
     @replytos = (header["in-reply-to"] || "").scan(/<(.+?)>/).map { |x| sanitize_message_id x.first }
 
     @replyto = Person.from_address header["reply-to"]
-    @list_address =
-      if header["list-post"]
-        @list_address = Person.from_address header["list-post"].gsub(/^<mailto:|>$/, "")
-      else
-        nil
+    @list_address = if header["list-post"]
+      address = if header["list-post"] =~ /mailto:(.*?)[>\s$]/
+        $1
+      elsif list-post =~ /@/
+        header["list-post"] # just try the whole fucking thing
       end
+      address && Person.from_address(address)
+    elsif header["x-mailing-list"]
+      Person.from_address header["x-mailing-list"]
+    end
 
     @recipient_email = header["envelope-to"] || header["x-original-to"] || header["delivered-to"]
     @source_marked_read = header["status"] == "RO"