From 7185da524d81acaaa872f8f803870d8c57c8b4c9 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sun, 21 Aug 2011 22:29:11 +0200 Subject: [PATCH] (smtpmail-query-smtp-server): Allow `quit'-ing out in case the probe hangs. --- lisp/ChangeLog | 2 ++ lisp/mail/smtpmail.el | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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))) -- 2.39.2