(imap-open): Return nil on failure.
(imap-open): Setup temp buffer correctly.
(imap-open): Return buffer only on success.
+ (imap-interactive-login, imap-interactive-login): Tell the user
+ which stream/authenticator is used for the queried
+ username/password.
+ (imap-open, imap-authenticate): Set variables.
2002-01-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
(while (or (not user) (not passwd))
(setq user (or imap-username
(read-from-minibuffer
- (concat "IMAP username for " imap-server ": ")
+ (concat "IMAP username for " imap-server
+ " (using stream `" (symbol-name imap-stream)
+ "'): ")
(or user imap-default-user))))
(setq passwd (or imap-password
(imap-read-passwd
(concat "IMAP password for " user "@"
- imap-server ": "))))
+ imap-server " (using authenticator `"
+ (symbol-name imap-auth) "'): "))))
(when (and user passwd)
(if (funcall loginfunc user passwd)
(progn
(mapcar 'make-local-variable imap-local-variables)
(imap-disable-multibyte)
(buffer-disable-undo)
+ (setq imap-server imap-server)
+ (setq imap-port imap-port)
+ (setq imap-auth imap-auth)
(message "imap: Reconnecting with stream `%s'..." stream)
(if (null (let ((imap-stream stream))
(imap-open-1 (current-buffer))))
imap-authenticator-alist)) buffer)
(setq imap-state 'auth))
;; Choose authenticator.
- (let (auth
- (auths imap-authenticators))
+ (let ((auths imap-authenticators)
+ auth)
(while (setq auth (pop auths))
;; OK to use authenticator?
(when (funcall (nth 1 (assq auth imap-authenticator-alist)) buffer)
(message "imap: Authenticating to `%s' using `%s'..."
imap-server auth)
+ (setq imap-auth auth)
(if (funcall (nth 2 (assq auth imap-authenticator-alist)) buffer)
(progn
(message "imap: Authenticating to `%s' using `%s'...done"
imap-server auth)
- (setq imap-auth auth
- auths nil))
+ (setq auths nil))
(message "imap: Authenticating to `%s' using `%s'...failed"
imap-server auth)))))
imap-state))))