2001-01-09 Yuuichi Teranishi <teranisi@gohome.org>
+ * elmo-net.el (elmo-network-session-password-key): Don't set default to
+ 'plain.
+
+ * elmo-util.el (elmo-imap4-get-spec): Set default of auth to 'clear.
+ (elmo-pop3-get-spec): Set default of auth to 'user.
+
* elmo-imap4.el (elmo-imap4-session-check):
Clear `elmo-imap4-fetch-callback' and `elmo-imap4-fetch-callback-data'.
+ (elmo-imap4-clear-login): New function; Renamed from `elmo-imap4-login'.
+ (elmo-imap4-auth-login): New function; Revival.
+ (elmo-network-authenticate-session): Use `elmo-imap4-clear-login' and
+ `elmo-imap4-auth-login'.
2000-12-29 TAKAHASHI Kaoru <kaoru@kaisei.org>
elmo-default-imap4-user)
(setq append-serv (concat ":" (elmo-imap4-spec-username spec))))
(unless (eq (elmo-imap4-spec-auth spec)
- elmo-default-imap4-authenticate-type)
+ elmo-default-imap4-authenticate-type)
(setq append-serv
(concat append-serv "/" (symbol-name (elmo-imap4-spec-auth spec)))))
(unless (string= (elmo-imap4-spec-hostname spec)
(elmo-read
(concat "(" (downcase (elmo-match-string 1 string)) ")"))))
-(defun elmo-imap4-login (session)
+(defun elmo-imap4-clear-login (session)
(let ((elmo-imap4-debug-inhibit-logging t))
(or
(elmo-imap4-read-ok
" "
(elmo-imap4-password
(elmo-get-passwd (elmo-network-session-password-key session))))))
- (signal 'elmo-authenticate-error '(login)))))
+ (signal 'elmo-authenticate-error '(elmo-imap4-clear-login)))))
+
+(defun elmo-imap4-auth-login (session)
+ (let ((tag (elmo-imap4-send-command session "authenticate login"))
+ (elmo-imap4-debug-inhibit-logging t))
+ (or (elmo-imap4-read-continue-req session)
+ (signal 'elmo-authenticate-error '(elmo-imap4-auth-login)))
+ (elmo-imap4-send-string session
+ (elmo-base64-encode-string
+ (elmo-network-session-user-internal session)))
+ (or (elmo-imap4-read-continue-req session)
+ (signal 'elmo-authenticate-error '(elmo-imap4-auth-login)))
+ (elmo-imap4-send-string session
+ (elmo-base64-encode-string
+ (elmo-get-passwd
+ (elmo-network-session-password-key session))))
+ (or (elmo-imap4-read-ok session tag)
+ (signal 'elmo-authenticate-error '(elmo-imap4-auth-login)))
+ (setq elmo-imap4-status 'auth)))
(luna-define-method
elmo-network-initialize-session-buffer :after ((session
(auth (if (listp auth) auth (list auth))))
(unless (or (eq elmo-imap4-status 'auth)
(null auth))
- (if (eq 'plain (car auth))
- (elmo-imap4-login session)
+ (cond
+ ((eq 'clear (car auth))
+ (elmo-imap4-clear-login session))
+ ((eq 'login (car auth))
+ (elmo-imap4-auth-login session))
+ (t
(let* ((elmo-imap4-debug-inhibit-logging t)
(sasl-mechanisms
(delq nil
(if (sasl-step-data step)
(elmo-base64-encode-string (sasl-step-data step)
'no-line-break)
- "")))))))))))
-
+ ""))))))))))))
+
(luna-define-method elmo-network-setup-session ((session
elmo-imap4-session))
(with-current-buffer (elmo-network-session-buffer session)
(setq auth (if (match-beginning 4)
(intern (elmo-match-substring 4 folder 1))
elmo-default-imap4-authenticate-type))
+ (setq auth (or auth 'clear))
(append (list 'imap4
(elmo-imap4-encode-folder-string mailbox)
user auth)
(setq auth (if (match-beginning 3)
(intern (elmo-match-substring 3 folder 1))
elmo-default-pop3-authenticate-type))
+ (setq auth (or auth 'user))
(append (list 'pop3 user auth)
(cdr spec)))))