Subject: [sup-talk] Using sup-config to add a GMail account as source

From: [email-masked] (Jjgod Jiang)
Date: Sat, 15 Dec 2007 04:58:57 +0800

Hi,

What's wrong with the IMAP server address I entered? It seemed correct to me.

What is the IMAP server (host, or host:port notation)? (enter for
"imap.gmail.com"): imap.gmail.com:993
What's the folder path? (enter for "INBOX"):
Whoopsie! I couldn't build a URI from that: bad component(expected
host component): imap.gmail.com:993
Try again? (enter for "n"):

I installed sup 0.3 via gem.

- Jiang

---

From: [email-masked] (William Morgan)
Date: Fri, 14 Dec 2007 14:25:33 -0800

> What's wrong with the IMAP server address I entered? It seemed correct

Oops, that's a bug. I've fixed it in SVN. Below is a patch you can use.
You can also use sup-add manually instead of going through sup-config.

Index: lib/sup/imap.rb
===================================================================
--- lib/sup/imap.rb	(revision 765)
+++ lib/sup/imap.rb	(working copy)
@@ -72,11 +72,7 @@
   end
 
   def self.suggest_labels_for path
-    if path =~ /inbox/i
-      [path.intern]
-    else
-      []
-    end
+    path =~ /([^\/]*inbox[^\/]*)/i ? [$1.downcase.intern] : []
   end
 
   def host; @parsed_uri.host; end
Index: bin/sup-config
===================================================================
--- bin/sup-config	(revision 765)
+++ bin/sup-config	(working copy)
@@ -96,7 +96,7 @@
         $last_folder = fn
 
         fn = "/#{fn}" # lame
-        if srv =~ /^(\w+):(\d+)$/
+        if srv =~ /^(\S+):(\d+)$/
           host, port = $1, $2.to_i
         else
           host, port = srv, nil

-- 
William <wmorgan-sup at masanjin.net>