From: Lars Magne Ingebrigtsen Date: Sun, 21 Aug 2011 20:29:11 +0000 (+0200) Subject: (smtpmail-query-smtp-server): Allow `quit'-ing out in case the probe hangs. X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~70^2~15^2~17 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7185da524d81acaaa872f8f803870d8c57c8b4c9;p=emacs.git (smtpmail-query-smtp-server): Allow `quit'-ing out in case the probe hangs. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f247abdd468..02c88eae667 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,8 @@ `coding-system-for-*' around the process open call to avoid auth-source side effects. (smtpmail-try-auth-methods): Expand the secret password. + (smtpmail-query-smtp-server): Allow `quit'-ing out in case the + probe hangs. 2011-08-21 Chong Yidong diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index f905eea8405..40fbb072594 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -602,8 +602,10 @@ The list is in preference order.") (push smtpmail-smtp-server ports)) (while (and (not smtpmail-smtp-server) (setq port (pop ports))) - (when (setq stream (ignore-errors - (open-network-stream "smtp" nil server port))) + (when (setq stream (condition-case () + (open-network-stream "smtp" nil server port) + (quit nil) + (error nil))) (customize-save-variable 'smtpmail-smtp-server server) (customize-save-variable 'smtpmail-smtp-service port) (delete-process stream)))