((or (eq pop3-stream-type 'ssl)
(and (not pop3-stream-type)
(member port '(995 "pop3s"))))
- :tls)
+ 'tls)
(t
(or pop3-stream-type 'network)))
:capability-command "CAPA\r\n"
- :end-of-command "^\\.\r?\n\\|^\\+[A-Z]+ .*\n"
+ :end-of-command "^\\.\r?\n\\|^\\(-ERR\\|+OK \\).*\n"
:success "^\\+OK.*\n"
:return-list t
:starttls-function
(substring response (or (string-match "<" response) 0)
(+ 1 (or (string-match ">" response) -1)))))
(pop3-set-process-query-on-exit-flag (car result) nil)
+ (erase-buffer)
(car result)))))
;; Support functions
(let ((start pop3-read-point) end)
(with-current-buffer (process-buffer process)
(while (not (re-search-forward "^\\.\r\n" nil t))
+ (unless (memq (process-status process) '(open run))
+ (error "pop3 server closed the connection"))
(pop3-accept-process-output process)
(goto-char start))
(setq pop3-read-point (point-marker))