sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 99e95dd3721080594acc9a1ab2d2a3623153775a
parent 739fa98b38fbf1f779c041ada43e4c56484b1cd1
Author: Sascha Silbe <sascha-pgp@silbe.org>
Date:   Tue, 29 Jun 2010 10:12:05 +0200

fix crash in sup-dump if the default sent source is used

This fixes a crash in sup-dump if the index contains a "sent" message and
no "sent" folder has been explicitly configured in the config file
(so it hasn't been added to sources.yaml).

Signed-off-by: Sascha Silbe 

Diffstat:
M bin/sup-dump | 7 +++++++
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/bin/sup-dump b/bin/sup-dump
@@ -19,9 +19,16 @@ Usage:
 EOS
 end
 
+$config = Redwood::load_config Redwood::CONFIG_FN
 index = Redwood::Index.init
 Redwood::SourceManager.init
 index.load
+Redwood::SentManager.init $config[:sent_source] || 'sup://sent'
+if(s = Redwood::SourceManager.source_for Redwood::SentManager.source_uri)
+  Redwood::SentManager.source = s
+else
+  Redwood::SourceManager.add_source Redwood::SentManager.default_source
+end
 
 index.each_message :load_spam => true, :load_deleted => true, :load_killed => true do |m|
   puts "#{m.id} (#{m.labels.to_a.sort_by { |l| l.to_s } * ' '})"