sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit bc90e8b01cfad5d4f5447f6726389e8e02917c06
parent 6884997935d45ab9a357738053650d2861e2d7c8
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date:   Sun, 28 Feb 2010 13:15:21 -0800

Merge commit 'mainline/remote-source-deprecation' into next

Diffstat:
M bin/sup | 20 ++++++++++++++++++++
M bin/sup-add | 17 -----------------
M bin/sup-config | 34 ----------------------------------
3 files changed, 20 insertions(+), 51 deletions(-)
diff --git a/bin/sup b/bin/sup
@@ -154,6 +154,26 @@ begin
   Index.load
   Index.start_sync_worker unless $opts[:no_threads]
 
+  if Redwood::SourceManager.sources.any? { |x| x.is_a? Redwood::MBox::SSHLoader }
+    $stderr.puts <<EOS
+mbox+ssh sources are deprecated and will be removed in the next release.
+Running rsync in your before-poll hook is a good alternative.
+
+Press enter to continue.
+EOS
+    $stdin.gets
+  end
+
+  if Redwood::SourceManager.sources.any? { |x| x.is_a? Redwood::IMAP }
+    $stderr.puts <<EOS
+IMAP sources are deprecated and will be removed in the next release.
+Running offlineimap or fetchmail in your before-poll hook is a good alternative.
+
+Press enter to continue.
+EOS
+    $stdin.gets
+  end
+
   $die = false
   trap("TERM") { |x| $die = true }
   trap("WINCH") { |x| BufferManager.sigwinch_happened! }
diff --git a/bin/sup-add b/bin/sup-add
@@ -20,15 +20,6 @@ For mbox files on local disk, use the form:
     mbox:<path to mbox file>, or
     mbox://<path to mbox file>
 
-For mbox files on remote machines, use the form:
-    mbox+ssh://<machine name>/<path to mbox file>
-
-For IMAP folders, use the form (note no username or password!):
-    imap://<machine name>/          # unsecure, "INBOX" folder  
-    imap://<machine name>/<folder>  # unsecure, arbitrary
-    imaps://<machine name>/         # secure, "INBOX" folder
-    imaps://<machine name>/<folder> # secure, arbitrary folder 
-
 For Maildir folders, use the form:
     maildir:<path to Maildir directory>; or
     maildir://<path to Maildir directory>
@@ -105,14 +96,6 @@ begin
 
     source = 
       case parsed_uri.scheme
-      when "mbox+ssh"
-        say "For SSH connections, if you will use public key authentication, you may leave the username and password blank."
-        say ""
-        username, password = get_login_info uri, Redwood::SourceManager.sources
-        Redwood::MBox::SSHLoader.new uri, username, password, nil, !$opts[:unusual], $opts[:archive], nil, labels
-      when "imap", "imaps"
-        username, password = get_login_info uri, Redwood::SourceManager.sources
-        Redwood::IMAP.new uri, username, password, nil, !$opts[:unusual], $opts[:archive], nil, labels
       when "maildir"
         Redwood::Maildir.new uri, nil, !$opts[:unusual], $opts[:archive], nil, labels
       when "mbox"
diff --git a/bin/sup-config b/bin/sup-config
@@ -44,9 +44,6 @@ def add_source
     menu.prompt = "What type of mail source is it? "
     menu.choice("mbox file") { type = :mbox }
     menu.choice("maildir directory") { type = :maildir }
-    menu.choice("remote mbox file (accessible via ssh)") { type = :mboxssh }
-    menu.choice("IMAP server (secure)") { type = :imaps }
-    menu.choice("IMAP server (unsecure)") { type = :imap }
     menu.choice("Get me out of here!") { return }
   end
 
@@ -70,37 +67,6 @@ def add_source
       $last_fn = fn
       [Redwood::Maildir.suggest_labels_for(fn),
        { :scheme => "maildir", :path => fn }]
-    when :mboxssh
-      $last_server ||= "localhost"
-      srv = axe "What machine is the mbox file located on?", $last_server
-      return if srv.nil? || srv.empty?
-      $last_server = srv
-
-      fn = axe "What's the path to the mbox file?", $last_fn
-      return if fn.nil? || fn.empty?
-      $last_fn = fn
-      fn = "/#{fn}" # lame
-      [Redwood::MBox::SSHLoader.suggest_labels_for(fn),
-       { :scheme => "mbox+ssh", :host => srv, :path => fn }]
-    when :imap, :imaps
-      $last_server ||= "localhost"
-      srv = axe "What is the IMAP server (host, or host:port notation)?", $last_server
-      return if srv.nil? || srv.empty?
-      $last_server = srv
-
-      $last_folder ||= "INBOX"
-      fn = axe "What's the folder path?", $last_folder
-      return if fn.nil? || fn.empty?
-      $last_folder = fn
-
-      fn = "/#{fn}"
-      if srv =~ /^(\S+):(\d+)$/
-        host, port = $1, $2.to_i
-      else
-        host, port = srv, nil
-      end
-      [Redwood::IMAP.suggest_labels_for(fn),
-       { :scheme => type.to_s, :host => host, :port => port, :path => fn }]
     end
 
     uri = begin