From 958f3c7c516b55b63d8b3af618502ffade28481a Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sat, 27 Nov 2010 19:52:05 +0100 Subject: [PATCH] Be more backwards-compatible. --- lisp/ChangeLog | 2 ++ lisp/nnimap.el | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f4369adde..83b429718 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,8 @@ * nnimap.el (nnimap-stream): Change default to `undecided'. (nnimap-open-connection): If `nnimap-stream' is `undecided', try ssl first, and then network. + (nnimap-open-connection-1): Respect nnimap-server-port. + (nnimap-open-connection): Be more backwards-compatible. * proto-stream.el (proto-stream-always-use-starttls): New variable. (proto-stream-open-starttls): De-duplicate the starttls code. diff --git a/lisp/nnimap.el b/lisp/nnimap.el index e217ac52c..47d222dea 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -303,6 +303,11 @@ textual parts.") (nnimap-send-command "NOOP"))))))) (defun nnimap-open-connection (buffer) + ;; Be backwards-compatible -- the earlier value of nnimap-stream was + ;; `ssl' when nnimap-server-port was nil. Sort of. + (when (and nnimap-server-port + (eq nnimap-stream 'undecided)) + (setq nnimap-stream 'ssl)) (let ((stream (if (eq nnimap-stream 'undecided) (loop for type in '(ssl network) @@ -341,6 +346,8 @@ textual parts.") (t (error "Unknown stream type: %s" nnimap-stream)))) connection-result login-result credentials) + (when nnimap-server-port + (push (format "%s" nnimap-server-port) ports)) (destructuring-bind (stream greeting capabilities) (open-proto-stream "*nnimap*" (current-buffer) nnimap-address (car (last ports)) @@ -367,8 +374,6 @@ textual parts.") (setf (nnimap-capabilities nnimap-object) (mapcar #'upcase (split-string capabilities))) - (when nnimap-server-port - (push (format "%s" nnimap-server-port) ports)) (unless (equal connection-result "PREAUTH") (if (not (setq credentials (if (eq nnimap-authenticator 'anonymous) -- 2.34.1