Move test/newsticker-testsuite.el to automated/newsticker-tests.el
[bpt/emacs.git] / lisp / mail / smtpmail.el
index 42c43c0..edcc820 100644 (file)
@@ -658,7 +658,7 @@ The list is in preference order.")
                   :always-query-capabilities t
                   :starttls-function
                   (lambda (capabilities)
-                    (and (string-match "-STARTTLS" capabilities)
+                    (and (string-match "[ -]STARTTLS" capabilities)
                          "STARTTLS\r\n"))
                   :client-certificate t
                   :use-starttls-if-possible t)))
@@ -773,8 +773,12 @@ The list is in preference order.")
                     (eq (car result) 530))
                ;; We got a "530 auth required", so we close and try
                ;; again, this time asking the user for a password.
-               (smtpmail-send-command process "QUIT")
-               (smtpmail-read-response process)
+               ;; We ignore any errors here, because some MTAs just
+               ;; close the connection immediately after giving the
+               ;; error message.
+               (ignore-errors
+                 (smtpmail-send-command process "QUIT")
+                 (smtpmail-read-response process))
                (delete-process process)
                (setq process nil)
                (throw 'done
@@ -835,7 +839,8 @@ The list is in preference order.")
 (defun smtpmail-process-filter (process output)
   (with-current-buffer (process-buffer process)
     (goto-char (point-max))
-    (insert output)))
+    (insert output)
+    (set-marker (process-mark process) (point))))
 
 (defun smtpmail-read-response (process)
   (let ((case-fold-search nil)