sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 111741d773cbc7eb0298842e34452943fdaef439
parent e79c3fed32712390ef2cceaae4dc07b133c1d7d8
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date:   Fri, 14 Jan 2011 20:05:24 -0800

Merge branch 'master' into next

Diffstat:
M CONTRIBUTORS | 21 ++++++++++++++++-----
M History.txt | 9 +++++++++
M ReleaseNotes | 9 +++++++++
M bin/sup-sync | 4 ++--
M lib/sup/maildir.rb | 8 ++++----
M lib/sup/mbox.rb | 9 +++------
M lib/sup/poll.rb | 6 +++---
M lib/sup/server.rb | 2 +-
M www/index.html | 23 +++++++++++++++++------
9 files changed, 64 insertions(+), 27 deletions(-)
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
@@ -3,6 +3,7 @@ Rich Lane <rlane at the club.cc.cmu dot edus>
 Ismo Puustinen <ismo at the iki dot fis>
 Nicolas Pouillard <nicolas.pouillard at the gmail dot coms>
 Eric Sherman <hyperbolist at the gmail dot coms>
+Michael Stapelberg <michael at the stapelberg dot des>
 Ben Walton <bwalton at the artsci.utoronto dot cas>
 Mike Stipicevic <stipim at the rpi dot edus>
 Marcus Williams <marcus-sup at the bar-coded dot nets>
@@ -10,34 +11,44 @@ Lionel Ott <white.magic at the gmx dot des>
 Tero Tilus <tero at the tilus dot nets>
 Ingmar Vanhassel <ingmar at the exherbo dot orgs>
 Mark Alexander <marka at the pobox dot coms>
+Gaute Hope <eg at the gaute.vetsj dot coms>
 Christopher Warrington <chrisw at the rice dot edus>
+W. Trevor King <wking at the drexel dot edus>
+Gaudenz Steinlin <gaudenz at the soziologie dot chs>
 Richard Brown <rbrown at the exherbo dot orgs>
 Marc Hartstein <marc.hartstein at the alum.vassar dot edus>
+Sascha Silbe <sascha-pgp at the silbe dot orgs>
 Israel Herraiz <israel.herraiz at the gmail dot coms>
 Anthony Martinez <pi+sup at the pihost dot uss>
-Michael Stapelberg <michael at the stapelberg dot des>
+Hamish Downer <dmishd at the gmail dot coms>
 Bo Borgerson <gigabo at the gmail dot coms>
 William Erik Baxter <web at the superscript dot coms>
+Michael Hamann <michael at the content-space dot des>
 Grant Hollingworth <grant at the antiflux dot orgs>
 Adeodato Simó <dato at the net.com.org dot ess>
 Daniel Schoepe <daniel.schoepe at the googlemail dot coms>
+Jason Petsod <jason at the petsod dot orgs>
 Steve Goldman <sgoldman at the tower-research dot coms>
 Edward Z. Yang <ezyang at the MIT dot EDUs>
 Decklin Foster <decklin at the red-bean dot coms>
 Cameron Matheson <cam+sup at the cammunism dot orgs>
 Carl Worth <cworth at the cworth dot orgs>
+Jeff Balogh <its.jeff.balogh at the gmail dot coms>
 Andrew Pimlott <andrew at the pimlott dot nets>
 Alex Vandiver <alexmv at the mit dot edus>
-Jeff Balogh <its.jeff.balogh at the gmail dot coms>
 Peter Harkins <ph at the malaprop dot orgs>
 Kornilios Kourtis <kkourt at the cslab.ece.ntua dot grs>
-Michael Hamann <michael at the content-space dot des>
 Giorgio Lando <patroclo7 at the gmail dot coms>
+Damien Leone <damien.leone at the fensalir dot frs>
 Benoît PIERRE <benoit.pierre at the gmail dot coms>
+Alvaro Herrera <alvherre at the alvh.no-ip dot orgs>
 Jonah <Jonah at the GoodCoffee dot cas>
+Adam Lloyd <adam at the alloy-d dot nets>
+Todd Eisenberger <teisenbe at the andrew.cmu dot edus>
 ian <ian at the lorf dot orgs>
 Steven Walter <swalter at the monarch.(none)>
-Alex Vandiver <alex at the chmrr dot nets>
-Stefan Lundström <lundst at the snabb.(none)>
+ian <itaylor at the uark dot edus>
 Jon M. Dugan <jdugan at the es dot nets>
+Gregor Hoffleit <gregor at the sam.mediasupervision dot des>
+Stefan Lundström <lundst at the snabb.(none)>
 Kirill Smelkov <kirr at the landau.phys.spbu dot rus>
diff --git a/History.txt b/History.txt
@@ -1,3 +1,12 @@
+== 0.12 / 2011-01-13
+* Remove deprecated IMAP, IMAPS, and mbox+ssh sources
+* Inline GPG support
+* Robust maildir support
+* sup-dump compatibility between Sup versions
+* New hook: sendmail
+* Better Ruby 1.9/UTF8 support
+* As always, many bugfixes and tweaks.
+
 == 0.11 / 2010-03-07
 * Remove deprecated Ferret backend.
 * Add deprecation notices to IMAP, IMAPS, and mbox+ssh sources.
diff --git a/ReleaseNotes b/ReleaseNotes
@@ -1,3 +1,12 @@
+Release 0.12:
+
+Deprecated remote sources have been removed.
+
+Maildir support has been improved to gracefully handle messages that
+move or disappear. The "out of sync" errors should no longer occur.
+
+Inline GPG is now supported.
+
 Release 0.11:
 
 The deprecated Ferret index has been removed.
diff --git a/bin/sup-sync b/bin/sup-sync
@@ -120,7 +120,7 @@ begin
     num_added = num_updated = num_scanned = num_restored = 0
     last_info_time = start_time = Time.now
 
-    Redwood::PollManager.poll_from source do |action,m,old_m|
+    Redwood::PollManager.poll_from source do |action,m,old_m,progress|
       if action == :delete
         puts "Deleting #{m.id}"
       elsif action == :add
@@ -176,7 +176,7 @@ begin
         if Time.now - last_info_time > PROGRESS_UPDATE_INTERVAL
           last_info_time = Time.now
           elapsed = last_info_time - start_time
-          pctdone = 0.0 * 100.0
+          pctdone = progress * 100.0
           remaining = (100.0 - pctdone) * (elapsed.to_f / pctdone)
           printf "## read %dm (~%.0f%%) @ %.1fm/s. %s elapsed, ~%s remaining\n", num_scanned, pctdone, num_scanned / elapsed, elapsed.to_time_s, remaining.to_time_s
         end
diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
@@ -101,17 +101,17 @@ class Maildir < Source
       debug "#{old_ids.size} in index, #{new_ids.size} in filesystem"
       debug "#{added.size} added, #{deleted.size} deleted"
 
-      added.each do |id|
+      added.each_with_index do |id,i|
         yield :add,
           :info => File.join(d,id),
           :labels => @labels + maildir_labels(id) + [:inbox],
-          :progress => 0.0
+          :progress => i.to_f/(added.size+deleted.size)
       end
 
-      deleted.each do |id|
+      deleted.each_with_index do |id,i|
         yield :delete,
           :info => File.join(d,id),
-          :progress => 0.0
+          :progress => (i.to_f+added.size)/(added.size+deleted.size)
       end
     end
     nil
diff --git a/lib/sup/mbox.rb b/lib/sup/mbox.rb
@@ -112,22 +112,19 @@ class MBox < Source
     end
   end
 
-  def pct_done
-    0.0
-  end
-
   def default_labels
     [:inbox, :unread]
   end
 
   def poll
-    offset = first_new_message
+    first_offset = first_new_message
+		offset = first_offset
     end_offset = File.size @f
     while offset and offset < end_offset
       yield :add,
         :info => offset,
         :labels => (labels + default_labels),
-        :progress => 0.0
+        :progress => (offset - first_offset).to_f/end_offset
       offset = next_offset offset
     end
   end
diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb
@@ -110,7 +110,7 @@ EOS
 
         num = 0
         numi = 0
-        poll_from source do |action,m,old_m|
+        poll_from source do |action,m,old_m,progress|
           if action == :delete
             yield "Deleting #{m.id}"
           elsif action == :add
@@ -164,7 +164,7 @@ EOS
           m.labels = old_m.labels + (m.labels - [:unread, :inbox]) if old_m
           m.locations = old_m.locations + m.locations if old_m
           HookManager.run "before-add-message", :message => m
-          yield :add, m, old_m if block_given?
+          yield :add, m, old_m, args[:progress] if block_given?
           Index.sync_message m, true
 
           ## We need to add or unhide the message when it either did not exist
@@ -176,7 +176,7 @@ EOS
         when :delete
           Index.each_message :location => [source.id, args[:info]] do |m|
             m.locations.delete Location.new(source, args[:info])
-            yield :delete, m, [source,args[:info]] if block_given?
+            yield :delete, m, [source,args[:info]], args[:progress] if block_given?
             Index.sync_message m, false
             #UpdateManager.relay self, :deleted, m
           end
diff --git a/lib/sup/server.rb b/lib/sup/server.rb
@@ -97,7 +97,7 @@ private
     SentManager.source.store_message Time.now, "test@example.com" do |io|
       io.write raw
     end
-    PollManager.poll_from SentManager.source do |sym,m,old_m|
+    PollManager.poll_from SentManager.source do |sym,m,old_m,progress|
       next unless sym == :add
       m.labels = labels
     end
diff --git a/www/index.html b/www/index.html
@@ -111,7 +111,7 @@
 		<h2>Status</h2>
 
 		<p>
-		The current version of Sup is 0.11, released 2010-03-07. This is a
+		The current version of Sup is 0.12, released 2011-01-13. This is a
 		beta release. It supports mbox and Maildir mailstores.
 		</p>
 
@@ -162,6 +162,7 @@
           <li> Ismo Puustinen </li>
           <li> Nicolas Pouillard </li>
           <li> Eric Sherman </li>
+          <li> Michael Stapelberg </li>
           <li> Ben Walton </li>
           <li> Mike Stipicevic </li>
           <li> Marcus Williams </li>
@@ -169,36 +170,46 @@
           <li> Tero Tilus </li>
           <li> Ingmar Vanhassel </li>
           <li> Mark Alexander </li>
+          <li> Gaute Hope </li>
           <li> Christopher Warrington </li>
+          <li> W. Trevor King </li>
+          <li> Gaudenz Steinlin </li>
           <li> Richard Brown </li>
           <li> Marc Hartstein </li>
+          <li> Sascha Silbe </li>
           <li> Israel Herraiz </li>
           <li> Anthony Martinez </li>
-          <li> Michael Stapelberg </li>
+          <li> Hamish Downer </li>
           <li> Bo Borgerson </li>
           <li> William Erik Baxter </li>
+          <li> Michael Hamann </li>
           <li> Grant Hollingworth </li>
           <li> Adeodato Simó </li>
           <li> Daniel Schoepe </li>
+          <li> Jason Petsod </li>
           <li> Steve Goldman </li>
           <li> Edward Z. Yang </li>
           <li> Decklin Foster </li>
           <li> Cameron Matheson </li>
           <li> Carl Worth </li>
+          <li> Jeff Balogh </li>
           <li> Andrew Pimlott </li>
           <li> Alex Vandiver </li>
-          <li> Jeff Balogh </li>
           <li> Peter Harkins </li>
           <li> Kornilios Kourtis </li>
-          <li> Michael Hamann </li>
           <li> Giorgio Lando </li>
+          <li> Damien Leone </li>
           <li> Benoît PIERRE </li>
+          <li> Alvaro Herrera </li>
           <li> Jonah </li>
+          <li> Adam Lloyd </li>
+          <li> Todd Eisenberger </li>
           <li> ian </li>
           <li> Steven Walter </li>
-          <li> Alex Vandiver </li>
-          <li> Stefan Lundström </li>
+          <li> ian </li>
           <li> Jon M. Dugan </li>
+          <li> Gregor Hoffleit </li>
+          <li> Stefan Lundström </li>
           <li> Kirill Smelkov </li>
         </ul>
         </p>