sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 21fb1c183be75ac19351599df445783424cfbb28
parent cfcc9614576658b2892512a4e54c310d86cb299e
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Sun, 22 Mar 2009 12:59:45 -0400

Merge branch 'master' into next

Diffstat:
M CONTRIBUTORS | 11 +++++++----
M History.txt | 12 ++++++++++++
M ReleaseNotes | 11 +++++++++++
M bugs/issue-60d86dd32054533a6206f698033ec668af6a7574.yaml | 10 ++++++++--
M lib/sup/mbox.rb | 4 ++--
M lib/sup/modes/thread-index-mode.rb | 2 +-
M test/test_message.rb | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M www/index.html | 30 +++++++++++++++++-------------
8 files changed, 152 insertions(+), 22 deletions(-)
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
@@ -1,14 +1,17 @@
 William Morgan <wmorgan-sup at the masanjin dot nets>
 Ismo Puustinen <ismo at the iki dot fis>
+Nicolas Pouillard <nicolas.pouillard at the gmail dot coms>
 Marcus Williams <marcus-sup at the bar-coded dot nets>
 Lionel Ott <white.magic at the gmx dot des>
-Nicolas Pouillard <nicolas.pouillard at the gmail dot coms>
+Mark Alexander <marka at the pobox dot coms>
+Christopher Warrington <chrisw at the rice dot edus>
 Marc Hartstein <marc.hartstein at the alum.vassar dot edus>
 Ben Walton <bwalton at the artsci.utoronto dot cas>
 Grant Hollingworth <grant at the antiflux dot orgs>
+Steve Goldman <sgoldman at the tower-research dot coms>
+Decklin Foster <decklin at the red-bean dot coms>
 Jeff Balogh <its.jeff.balogh at the gmail dot coms>
-Christopher Warrington <chrisw at the rice dot edus>
 Giorgio Lando <patroclo7 at the gmail dot coms>
-Decklin Foster <decklin at the red-bean dot coms>
+Israel Herraiz <israel.herraiz at the gmail dot coms>
 Ian Taylor <ian at the lorf dot orgs>
-Sam Roberts <sroberts at the uniserve dot coms>
+Rich Lane <rlane at the club.cc.cmu dot edus>
diff --git a/History.txt b/History.txt
@@ -1,3 +1,15 @@
+== 0.7 / 2009-03-16
+* Ferret index corruption issues fixed (hopefully!)
+* Text entry now scrolls to the right on overflow, i.e. is actually usable
+* Ctrl-C now asks user if Sup should die ungracefully
+* Add a limit:<int> search operator to limit the number of results
+* Added a --query option to sup-tweak-labels
+* Added a new hook: shutdown
+* Automatically add self as recipient on crypted sent messages
+* Read in X-Foo headers
+* Added global keybinding 'U' shows only unread messages
+* As always, many bugfixes and tweaks
+
 == 0.6 / 2008-08-04
 * new hooks: mark-as-spam, reply-to, reply-from
 * configurable colors. finally!
diff --git a/ReleaseNotes b/ReleaseNotes
@@ -1,3 +1,14 @@
+Release 0.7:
+
+The big win in this release is that Ferret index corruption issues should now
+be fixed, thanks to an extensive programming of locking and
+thread-safety-adding.
+
+The other nice change is that text entry will now scroll to the right upon
+overflow, thanks to some arcane Curses magic that Steve Goldman discovered.
+
+As always, this release includes many other bugfixes and enhancements.
+
 Release 0.6:
 
 Message attachment searchability automatically takes effect on new messages,
diff --git a/bugs/issue-60d86dd32054533a6206f698033ec668af6a7574.yaml b/bugs/issue-60d86dd32054533a6206f698033ec668af6a7574.yaml
@@ -5,8 +5,8 @@ type: :bugfix
 component: indexing
 release: 
 reporter: William Morgan <wmorgan-sup@masanjin.net>
-status: :unstarted
-disposition: 
+status: :closed
+disposition: :fixed
 creation_time: 2008-04-25 19:28:51.369257 Z
 references: []
 
@@ -20,4 +20,10 @@ log_events:
   - William Morgan <wmorgan-sup@masanjin.net>
   - unassigned from release 0.6
   - ""
+- - 2008-11-21 14:23:17.566852 Z
+  - Nicolas Pouillard <nicolas.pouillard@gmail.com>
+  - closed with disposition fixed
+  - |-
+    Loading options was not given to load_thread_for_message in
+    ThreadIndexMode.add_or_unhide.
 git_branch: 
diff --git a/lib/sup/mbox.rb b/lib/sup/mbox.rb
@@ -11,7 +11,7 @@ module Redwood
 ## TODO: move functionality to somewhere better, like message.rb
 module MBox
   BREAK_RE = /^From \S+/
-  HEADER_RE = /\s*(.*?\S)\s*/
+  HEADER_RE = /\s*(.*?)\s*/
 
   def read_header f
     header = {}
@@ -39,7 +39,7 @@ module MBox
         /^(List-Subscribe):#{HEADER_RE}$/i,
         /^(List-Unsubscribe):#{HEADER_RE}$/i,
         /^(Status):#{HEADER_RE}$/i,
-	/^(X-\S+):#{HEADER_RE}$/: header[last = $1] = $2
+        /^(X-\S+):#{HEADER_RE}$/: header[last = $1] = $2
       when /^(Message-Id):#{HEADER_RE}$/i: header[mid_field = last = $1] = $2
 
       when /^\r*$/: break
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
@@ -664,7 +664,7 @@ protected
   def add_or_unhide m
     @ts_mutex.synchronize do
       if (is_relevant?(m) || @ts.is_relevant?(m)) && !@ts.contains?(m)
-        @ts.load_thread_for_message m
+        @ts.load_thread_for_message m, @load_thread_opts
       end
 
       @hidden_threads.delete @ts.thread_for(m)
diff --git a/test/test_message.rb b/test/test_message.rb
@@ -428,6 +428,100 @@ EOS
 
   end
   
+  def test_blank_header_lines
+
+    message = <<EOS
+Return-Path: <monitor-list-bounces@widget.com>
+X-Original-To: nobody@localhost
+Delivered-To: nobody@localhost.eng.widget.com
+Received: from localhost (localhost.localdomain [127.0.0.1])
+	by soquel.eng.widget.com (Postfix) with ESMTP id 609BC13C0DB1
+	for <nobody@localhost>; Thu, 19 Mar 2009 13:43:21 -0700 (PDT)
+MIME-Version: 1.0
+Received: from pa-excas-vip.widget.com [10.16.67.200]
+	by localhost with IMAP (fetchmail-6.2.5)
+	for nobody@localhost (single-drop); Thu, 19 Mar 2009 13:43:21 -0700 (PDT)
+Received: from pa-exht01.widget.com (10.113.81.167) by pa-excaht11.widget.com
+ (10.113.81.197) with Microsoft SMTP Server (TLS) id 8.1.311.2; Thu, 19 Mar
+ 2009 13:42:30 -0700
+Received: from mailman2.widget.com (10.16.64.159) by pa-exht01.widget.com
+ (10.113.81.167) with Microsoft SMTP Server id 8.1.336.0; Thu, 19 Mar 2009
+ 13:42:30 -0700
+Received: by mailman2.widget.com (Postfix)	id 47095AE30856; Thu, 19 Mar 2009
+ 13:42:29 -0700 (PDT)
+Received: from countchocula.widget.com (localhost.localdomain [127.0.0.1])	by
+ mailman2.widget.com (Postfix) with ESMTP id 5F782ABC5948;	Thu, 19 Mar 2009
+ 13:42:28 -0700 (PDT)
+Received: from mailhost4.widget.com (mailhost4.widget.com [10.16.67.124])	by
+ mailman2.widget.com (Postfix) with ESMTP id 6CDCCABC5948	for
+ <monitor-list@mailman2.widget.com>;	Thu, 19 Mar 2009 13:42:26 -0700 (PDT)
+Received: by mailhost4.widget.com (Postfix)	id 2364AC9AC4; Thu, 19 Mar 2009
+ 13:42:26 -0700 (PDT)
+Received: from pa-exht01.widget.com (pa-exht01.widget.com [10.113.81.167])	by
+ mailhost4.widget.com (Postfix) with ESMTP id 17A68C9AC3	for
+ <monitor-list@widget.com>; Thu, 19 Mar 2009 13:42:26 -0700 (PDT)
+Received: from PA-EXMBX04.widget.com ([10.113.81.142]) by pa-exht01.widget.com
+	([10.113.81.167]) with mapi; Thu, 19 Mar 2009 13:42:26 -0700
+From: Some User <someuser@widget.com>
+To: "monitor-list@widget.com" <monitor-list@widget.com>
+Sender: "monitor-list-bounces@widget.com" <monitor-list-bounces@widget.com>
+Date: Thu, 19 Mar 2009 13:42:25 -0700
+Subject: Looking for a mac
+Thread-Topic: Looking for a mac
+Thread-Index: AQHJqNM1xIqqjNRWuUCUBaxzPFK5eQ==
+Message-ID:
+ <D3C12B2AD838B44DA9D6B2CA334246D011E72A73A4@PA-EXMBX04.widget.com>
+List-Help: <mailto:monitor-list-request@widget.com?subject=help>
+List-Subscribe: <http://mailman2.widget.com/mailman/listinfo/monitor-list>,
+	<mailto:monitor-list-request@widget.com?subject=subscribe>
+List-Unsubscribe:
+ <http://mailman2.widget.com/mailman/listinfo/monitor-list>,
+ 	<mailto:monitor-list-request@widget.com?subject=unsubscribe>
+Accept-Language: en-US
+Content-Language: en-US
+X-MS-Exchange-Organization-AuthAs: Anonymous
+X-MS-Exchange-Organization-AuthSource: pa-exht01.widget.com
+X-MS-Has-Attach:
+X-Auto-Response-Suppress: All
+X-MS-TNEF-Correlator:
+acceptlanguage: en-US
+delivered-to: monitor-list@widget.com
+errors-to: monitor-list-bounces@widget.com
+list-id: engineering monitor related <monitor-list.widget.com>
+x-mailman-version: 2.1.8
+x-beenthere: monitor-list@widget.com
+x-original-to: monitor-list@mailman2.widget.com
+list-post: <mailto:monitor-list@widget.com>
+list-archive: <http://mailman2.widget.com/pipermail/monitor-list>
+Content-Type: text/plain; charset="us-ascii"
+Content-Transfer-Encoding: quoted-printable
+
+Hi all,
+
+    Just wondering if anybody can lend me a mac to reproduce PR 384931 ?
+    Thanks.
+
+Michael=
+EOS
+
+    source = DummySource.new("sup-test://test_blank_header_lines")
+    source.messages = [ message ]
+    source_info = 0
+
+    sup_message = Message.new( {:source => source, :source_info => source_info } )
+
+    # See how well parsing the message ID went.
+    id = sup_message.id
+    assert_equal("D3C12B2AD838B44DA9D6B2CA334246D011E72A73A4@PA-EXMBX04.widget.com", id)
+
+    # Look at another header field whose first line was blank.
+    list_unsubscribe = sup_message.list_unsubscribe
+    assert_equal(" <http://mailman2.widget.com/mailman/listinfo/monitor-list>, " +
+                 "<mailto:monitor-list-request@widget.com?subject=unsubscribe>",
+                 list_unsubscribe)
+
+  end
+
   # TODO: test different error cases, malformed messages etc.
 
   # TODO: test different quoting styles, see that they are all divided
diff --git a/www/index.html b/www/index.html
@@ -109,7 +109,7 @@
 		<h2>Status</h2>
 
 		<p>
-		The current version of Sup is 0.6, released 2008-08-03. This is a
+		The current version of Sup is 0.7, released 2009-03-16. This is a
 		beta release. It supports mbox, mbox over ssh, IMAP, IMAPS, and Maildir mailstores.
 		</p>
 
@@ -143,18 +143,22 @@
 		<p>
 		Sup is brought to you by <a href="http://cs.stanford.edu/~ruby/">William Morgan</a> and the following honorable contributors:
         <ul>
-          Ismo Puustinen &lt;ismo at the iki dot fis&gt;
-          Marcus Williams &lt;marcus-sup at the bar-coded dot nets&gt;
-          Lionel Ott &lt;white.magic at the gmx dot des&gt;
-          Nicolas Pouillard &lt;nicolas.pouillard at the gmail dot coms&gt;
-          Marc Hartstein &lt;marc.hartstein at the alum.vassar dot edus&gt;
-          Ben Walton &lt;bwalton at the artsci.utoronto dot cas&gt;
-          Grant Hollingworth &lt;grant at the antiflux dot orgs&gt;
-          Jeff Balogh &lt;its.jeff.balogh at the gmail dot coms&gt;
-          Christopher Warrington &lt;chrisw at the rice dot edus&gt;
-          Giorgio Lando &lt;patroclo7 at the gmail dot coms&gt;
-          Decklin Foster &lt;decklin at the red-bean dot coms&gt;
-          Ian Taylor &lt;ian at the lorf dot orgs&gt;
+William Morgan &lt;wmorgan-sup at the masanjin dot nets&gt;
+Ismo Puustinen &lt;ismo at the iki dot fis&gt;
+Nicolas Pouillard &lt;nicolas.pouillard at the gmail dot coms&gt;
+Marcus Williams &lt;marcus-sup at the bar-coded dot nets&gt;
+Lionel Ott &lt;white.magic at the gmx dot des&gt;
+Christopher Warrington &lt;chrisw at the rice dot edus&gt;
+Marc Hartstein &lt;marc.hartstein at the alum.vassar dot edus&gt;
+Ben Walton &lt;bwalton at the artsci.utoronto dot cas&gt;
+Grant Hollingworth &lt;grant at the antiflux dot orgs&gt;
+Steve Goldman &lt;sgoldman at the tower-research dot coms&gt;
+Decklin Foster &lt;decklin at the red-bean dot coms&gt;
+Jeff Balogh &lt;its.jeff.balogh at the gmail dot coms&gt;
+Giorgio Lando &lt;patroclo7 at the gmail dot coms&gt;
+Israel Herraiz &lt;israel.herraiz at the gmail dot coms&gt;
+Ian Taylor &lt;ian at the lorf dot orgs&gt;
+Rich Lane &lt;rlane at the club.cc.cmu dot edus&gt;
         </ul>
         </p>