The end_offset reported by imap and maildir sources was incorrect if there was
only one message in the source. Since end_offset is exclusive, we must add one 
to
the last known id to get include all valid message ids in the range.
---
 lib/sup/imap.rb    |    2 +-
 lib/sup/maildir.rb |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/sup/imap.rb b/lib/sup/imap.rb
index e785597..1d36976 100644
--- a/lib/sup/imap.rb
+++ b/lib/sup/imap.rb
@@ -176,7 +176,7 @@ class IMAP < Source
 
   def end_offset
     unsynchronized_scan_mailbox
-    @ids.last
+    @ids.last + 1
   end
   synchronized :end_offset
 
diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
index 5c9600d..584e657 100644
--- a/lib/sup/maildir.rb
+++ b/lib/sup/maildir.rb
@@ -123,7 +123,7 @@ class Maildir < Source
 
   def end_offset
     scan_mailbox :rescan => true
-    @ids.last
+    @ids.last + 1
   end
 
   def pct_done; 100.0 * (@ids.index(cur_offset) || 0).to_f / (@ids.length - 
1).to_f; end
-- 
1.5.3.7

_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk

Reply via email to