Be more backwards-compatible.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 27 Nov 2010 18:52:05 +0000 (19:52 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 27 Nov 2010 18:52:05 +0000 (19:52 +0100)
lisp/ChangeLog
lisp/nnimap.el

index f4369ad..83b4297 100644 (file)
@@ -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.
index e217ac5..47d222d 100644 (file)
@@ -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)