summaryrefslogtreecommitdiff
path: root/lisp/net/imap.el
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2016-01-31 14:29:14 +0100
committerAndreas Schwab <schwab@linux-m68k.org>2016-01-31 14:37:33 +0100
commitfc48106d0bdbd938ec51c1f9609b7a58108d8f00 (patch)
tree9e2225d67053f159656121050a509ad23a8f83f8 /lisp/net/imap.el
parentcdecbedbf0cc0872bc41e842f67a5af40109f29d (diff)
downloademacs-fc48106d0bdbd938ec51c1f9609b7a58108d8f00.tar.gz
Fix imap-starttls-open
* lisp/net/imap.el (imap-starttls-open): Log imap process output. Call imap-parse-greeting. (Bug#22500)
Diffstat (limited to 'lisp/net/imap.el')
-rw-r--r--lisp/net/imap.el19
1 files changed, 12 insertions, 7 deletions
diff --git a/lisp/net/imap.el b/lisp/net/imap.el
index 7e4cc72028f..e5a14d75dee 100644
--- a/lisp/net/imap.el
+++ b/lisp/net/imap.el
@@ -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))