1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

(smtpmail-query-smtp-server): Allow `quit'-ing out in case the probe hangs.

This commit is contained in:
Lars Magne Ingebrigtsen 2011-08-21 22:29:11 +02:00
parent e7f2c178da
commit 7185da524d
2 changed files with 6 additions and 2 deletions

View File

@ -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 <cyd@stupidchicken.com>

View File

@ -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)))