sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit f8a661f77007eca8965c0af28cacb3d588ec48df
parent 465349e03930b9b5fd6962209db69a0fc15bfb35
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Sat, 27 Oct 2007 00:23:57 +0000

handle url-escaped imap folder names

git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@613 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M doc/TODO | 12 ++++++++++--
M lib/sup/imap.rb | 3 ++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/doc/TODO b/doc/TODO
@@ -1,3 +1,11 @@
+for 0.2
+-------
+
+_ bugfix: contacts.txt isn't parsed correctly when there are spaces in
+   aliases
+_ bugfix: @ signs in names make sendmail die silently
+x bugfix: need to URL-unescape maildir folders
+
 for 0.3
 -------
 _ mailing list subscribe/unsubscribe
@@ -6,8 +14,8 @@ _ messages as attachments
 _ flesh out gpg integration: sign & encrypt outgoing
 _ mbox: don't keep filehandles open, and protect all reads with dotlockfile
 _ bugfix: screwing with the headers when editing causes a crash
-_ bugfix: need a better way to force an address to a particular name,
-  for things like evite addresses
+_ need a better way to force an address to a particular name,
+   for things like evite addresses
 _ pressing A in thread-view-mode should jump to next message
 _ bugfix: aliases can't have spaces; check on input and handle loading
    parse errors gracefully
diff --git a/lib/sup/imap.rb b/lib/sup/imap.rb
@@ -3,6 +3,7 @@ require 'net/imap'
 require 'stringio'
 require 'time'
 require 'rmail'
+require 'cgi'
 
 ## fucking imap fucking sucks. what the FUCK kind of committee of
 ## dunces designed this shit.
@@ -82,7 +83,7 @@ class IMAP < Source
   def port; @parsed_uri.port || (ssl? ? 993 : 143); end
   def mailbox
     x = @parsed_uri.path[1..-1]
-    x.nil? || x.empty? ? 'INBOX' : x
+    (x.nil? || x.empty?) ? 'INBOX' : CGI.unescape(x)
   end
   def ssl?; @parsed_uri.scheme == 'imaps' end