]> code.delx.au - gnu-emacs/commitdiff
Fix imap-starttls-open
authorAndreas Schwab <schwab@linux-m68k.org>
Sun, 31 Jan 2016 13:29:14 +0000 (14:29 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Sun, 31 Jan 2016 13:37:33 +0000 (14:37 +0100)
* lisp/net/imap.el (imap-starttls-open): Log imap process
output.  Call imap-parse-greeting.  (Bug#22500)

lisp/net/imap.el

index 7e4cc72028f1de1a090076a7de1a6c44b33133dc..e5a14d75dee27103258188a6de00eb6e3b997c69 100644 (file)
@@ -747,14 +747,19 @@ sure of changing the value of `foo'."
                    :capability-command "1 CAPABILITY\r\n"
                    :always-query-capabilities t
                    :end-of-command "\r\n"
-                   :success " OK "
+                   :success "^1 OK "
                    :starttls-function
-                   (lambda (capabilities)
-                     (when (string-match-p "STARTTLS" capabilities)
-                       "1 STARTTLS\r\n"))))
-         (done (if (and process
-                        (memq (process-status process) '(open run)))
-                   process)))
+                   #'(lambda (capabilities)
+                       (when (string-match-p "STARTTLS" capabilities)
+                         "1 STARTTLS\r\n"))))
+         done)
+    (when process
+      (imap-log buffer)
+      (when (memq (process-status process) '(open run))
+        (setq done process)
+        (with-current-buffer buffer
+          (goto-char (point-min))
+          (imap-parse-greeting))))
     (message "imap: Connecting with STARTTLS...%s" (if done "done" "failed"))
     done))