diff options
| author | Simon Josefsson | 2004-03-11 10:53:22 +0000 |
|---|---|---|
| committer | Simon Josefsson | 2004-03-11 10:53:22 +0000 |
| commit | 2ceed428a9d3fe7e3747c7c2266e73791ef2f56c (patch) | |
| tree | 65c5014fee838f59a2c342d6a6595320e9dad5cf /lisp/mail | |
| parent | 5243c06a3adf27d5904bf02f3ff9f4456a3e9ad8 (diff) | |
| download | emacs-2ceed428a9d3fe7e3747c7c2266e73791ef2f56c.tar.gz emacs-2ceed428a9d3fe7e3747c7c2266e73791ef2f56c.zip | |
(smtpmail-read-response): Abort if process has
died to avoid infloop. Reported by Jonathan Glauner
<jglauner@sbum.org>.
Diffstat (limited to 'lisp/mail')
| -rw-r--r-- | lisp/mail/smtpmail.el | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index e516133c6a0..3ebea497e87 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail | 1 | ;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1995, 1996, 2001, 2002, 2003 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp> | 5 | ;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp> |
| 6 | ;; Maintainer: Simon Josefsson <simon@josefsson.org> | 6 | ;; Maintainer: Simon Josefsson <simon@josefsson.org> |
| @@ -778,49 +778,49 @@ This is relative to `smtpmail-queue-dir'.") | |||
| 778 | (response-continue t) | 778 | (response-continue t) |
| 779 | (return-value '(nil ())) | 779 | (return-value '(nil ())) |
| 780 | match-end) | 780 | match-end) |
| 781 | 781 | (catch 'done | |
| 782 | (while response-continue | 782 | (while response-continue |
| 783 | (goto-char smtpmail-read-point) | 783 | (goto-char smtpmail-read-point) |
| 784 | (while (not (search-forward "\r\n" nil t)) | 784 | (while (not (search-forward "\r\n" nil t)) |
| 785 | (accept-process-output process) | 785 | (unless (memq (process-status process) '(open run)) |
| 786 | (goto-char smtpmail-read-point)) | 786 | (throw 'done nil)) |
| 787 | 787 | (accept-process-output process) | |
| 788 | (setq match-end (point)) | 788 | (goto-char smtpmail-read-point)) |
| 789 | (setq response-strings | 789 | |
| 790 | (cons (buffer-substring smtpmail-read-point (- match-end 2)) | 790 | (setq match-end (point)) |
| 791 | response-strings)) | 791 | (setq response-strings |
| 792 | 792 | (cons (buffer-substring smtpmail-read-point (- match-end 2)) | |
| 793 | (goto-char smtpmail-read-point) | 793 | response-strings)) |
| 794 | (if (looking-at "[0-9]+ ") | 794 | |
| 795 | (let ((begin (match-beginning 0)) | 795 | (goto-char smtpmail-read-point) |
| 796 | (end (match-end 0))) | 796 | (if (looking-at "[0-9]+ ") |
| 797 | (if smtpmail-debug-info | 797 | (let ((begin (match-beginning 0)) |
| 798 | (message "%s" (car response-strings))) | 798 | (end (match-end 0))) |
| 799 | 799 | (if smtpmail-debug-info | |
| 800 | (setq smtpmail-read-point match-end) | 800 | (message "%s" (car response-strings))) |
| 801 | 801 | ||
| 802 | ;; ignore lines that start with "0" | 802 | (setq smtpmail-read-point match-end) |
| 803 | (if (looking-at "0[0-9]+ ") | 803 | |
| 804 | nil | 804 | ;; ignore lines that start with "0" |
| 805 | (if (looking-at "0[0-9]+ ") | ||
| 806 | nil | ||
| 807 | (setq response-continue nil) | ||
| 808 | (setq return-value | ||
| 809 | (cons (string-to-int | ||
| 810 | (buffer-substring begin end)) | ||
| 811 | (nreverse response-strings))))) | ||
| 812 | |||
| 813 | (if (looking-at "[0-9]+-") | ||
| 814 | (progn (if smtpmail-debug-info | ||
| 815 | (message "%s" (car response-strings))) | ||
| 816 | (setq smtpmail-read-point match-end) | ||
| 817 | (setq response-continue t)) | ||
| 818 | (progn | ||
| 819 | (setq smtpmail-read-point match-end) | ||
| 805 | (setq response-continue nil) | 820 | (setq response-continue nil) |
| 806 | (setq return-value | 821 | (setq return-value |
| 807 | (cons (string-to-int | 822 | (cons nil (nreverse response-strings))))))) |
| 808 | (buffer-substring begin end)) | 823 | (setq smtpmail-read-point match-end)) |
| 809 | (nreverse response-strings))))) | ||
| 810 | |||
| 811 | (if (looking-at "[0-9]+-") | ||
| 812 | (progn (if smtpmail-debug-info | ||
| 813 | (message "%s" (car response-strings))) | ||
| 814 | (setq smtpmail-read-point match-end) | ||
| 815 | (setq response-continue t)) | ||
| 816 | (progn | ||
| 817 | (setq smtpmail-read-point match-end) | ||
| 818 | (setq response-continue nil) | ||
| 819 | (setq return-value | ||
| 820 | (cons nil (nreverse response-strings))) | ||
| 821 | ) | ||
| 822 | ))) | ||
| 823 | (setq smtpmail-read-point match-end) | ||
| 824 | return-value)) | 824 | return-value)) |
| 825 | 825 | ||
| 826 | 826 | ||