Added feature: allow email address as user name for imap.
authorVitaly Mayatskikh <vitaly@gravicappa.englab.brq.redhat.com>
Mon, 27 Oct 2008 19:23:58 +0000 (27 20:23 +0100)
committerVitaly Mayatskikh <vitaly@gravicappa.englab.brq.redhat.com>
Mon, 27 Oct 2008 19:23:58 +0000 (27 20:23 +0100)
Some imap servers (for example, gmx.com) requires email as user name to
login. Sign `@' is a delimeter for network server name, 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 09f2891..83e70de 100644 (file)
@@ -1973,9 +1973,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