Added feature: allow email address as user name for imap.
authorvitaly <vitaly>
Tue, 26 May 2009 15:06:40 +0000 (15:06 +0000)
committervitaly <vitaly>
Tue, 26 May 2009 15:06:40 +0000 (15:06 +0000)
Some imap servers (for example, gmx.com) requires email as user name to login.
Sign `@' is a delimeter for network server name in folders-file, so use `*'
instead of it in user names and convert it to `@' in place. You have to write
your real user name `xxx@gmx.com' like `xxx*gmx.com' in ~/.folders or config
file.

elmo/elmo-imap4.el

index 92bec96..1f2576d 100644 (file)
@@ -1907,9 +1907,15 @@ Return nil if no complete line has arrived."
                                            (elmo-imap4-encode-folder-string
                                             (cdr (assq 'mailbox tokens))))
     ;; user
-    (elmo-net-folder-set-user-internal folder
-                                      (or (cdr (assq 'user tokens))
-                                          default-user))
+    (elmo-net-folder-set-user-internal 
+     folder
+     (let ((user (cdr (assq 'user tokens))))
+       (if user
+          (if (string-match "*" user)
+              (replace-match "@" nil nil user)
+            user)
+        default-user)))
+
     ;; auth
     (elmo-net-folder-set-auth-internal
      folder