Connection refused by SMTP server

Hiroya Murata <[email protected]> Sun, 24 Jul 2005 15:06:55 +0900
Newsgroups gmane.mail.wanderlust.general.japanese,gmane.mail.emacs.mime.japanese
Message-ID <uu0ik4u0w.wl%[email protected]>
smtp.el を使っての mail 送信で, 送信自体は成功しているけど, 送信処
理が終了しない (C-g で中断は出来る) 状態になる事があるそうです.

どうやら, Gmail の SMTPサーバが, QUIT コマンドの後で応答を返さずに
接続を切ってしまうらしく, この場合 smtp-read-response で応答待ちで
無限ループになってしまっている様です.  まあサーバが悪いのですが,
こういった場合は, 無限ループになるよりはエラーになる方が良いと思い,
添付のパッチを作成しました.

修正内容に問題がないようでしたら commit したいのですが, 如何でしょ
うか?

;; 後で, emacs 付属の smtpmail.el を確認した所, 同様の変更がされて
;; いるみたいでした.

-- 
Hiroya Murata (村田 浩也)
PGP fingerprint: 53B6 1B4A 8193 A2D4 1526  BC9E 9AEF 2F6D 249D 5F17
smtp.el.patch (application/octet-stream, 623 B)
Index: smtp.el
===================================================================
RCS file: /cvs/root/flim/smtp.el,v
retrieving revision 1.5.2.21
diff -u -w -r1.5.2.21 smtp.el
--- smtp.el	6 Jul 2005 02:09:05 -0000	1.5.2.21
+++ smtp.el	22 Jul 2005 05:23:52 -0000
@@ -654,6 +655,8 @@
     (while response-continue
       (goto-char smtp-read-point)
       (while (not (search-forward smtp-end-of-line nil t))
+	(unless (smtp-connection-opened connection)
+	  (signal 'smtp-error "Connection refused"))
 	(accept-process-output (smtp-connection-process-internal connection))
 	(goto-char smtp-read-point))
       (if decoder