* registry.el (registry-full): Fix logic.
[gnus] / lisp / pop3.el
index 2266510..6f12d3d 100644 (file)
@@ -264,10 +264,6 @@ Use streaming commands."
     (pop3-quit process)
     message-count))
 
-(autoload 'open-tls-stream "tls")
-(autoload 'starttls-open-stream "starttls")
-(autoload 'starttls-negotiate "starttls") ; avoid warning
-
 (defcustom pop3-stream-type nil
   "*Transport security type for POP3 connexions.
 This may be either nil (plain connexion), `ssl' (use an
@@ -306,16 +302,16 @@ Returns the process associated with the connection."
                    ((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
             (lambda (capabilities)
-              (and (string-match "STLS" capabilities)
+              (and (string-match "\\bSTLS\\b" capabilities)
                    "STLS\r\n"))))
       (when result
        (let ((response (plist-get (cdr result) :greeting)))