From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.devel Subject: Re: [cc@ivu-ac.de: Re: Problem sending bigger mails with CVS Gnus + CVS Emacs] Date: Sun, 19 May 2002 02:07:50 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: References: <200205181849.g4IInZx22152@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1021766939 18724 127.0.0.1 (19 May 2002 00:08:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 19 May 2002 00:08:59 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 179EFv-0004rt-00 for ; Sun, 19 May 2002 02:08:59 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 179ET7-0006XV-00 for ; Sun, 19 May 2002 02:22:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 179EGB-0002Pe-00; Sat, 18 May 2002 20:09:15 -0400 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net ([217.13.230.178] helo=yxa.extundo.com) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 179EEv-0002Mu-00; Sat, 18 May 2002 20:07:57 -0400 Original-Received: from latte.josefsson.org (yxa.extundo.com [217.13.230.178]) (authenticated bits=0) by yxa.extundo.com (8.12.3/8.12.3) with ESMTP id g4J07oWa004497; Sun, 19 May 2002 02:07:54 +0200 Original-To: Christoph Conrad In-Reply-To: <200205181849.g4IInZx22152@aztec.santafe.edu> (Richard Stallman's message of "Sat, 18 May 2002 12:49:35 -0600 (MDT)") Original-Lines: 121 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2.50 (i686-pc-linux-gnu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:4108 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:4108 This bug might be related to the "deadlock" workarounds in Gnus -- whenever lots of data is sent, it calls `accept-process-output' once in a while to prevent deadlocks (see e.g. nntp.el, search for "dead"). However, I'm often sending multi-MB mail using smtpmail.el, so I suspect it is a subtle bug (I'm using redhat, the reporter is using windows). Christoph, can you try this patch instead of your defadvice? Also, please frob smtpmail-debug-info to non-nil and mail the contents in the *trace of SMTP session to server* buffer after sending a large mail. smtpmail.el is not very nicely coded, it calls process-send-* in lots of places without first checking if the process is still alive. So if the connection is dropped or similar, the code will always cause the elisp error you got. --- smtpmail.el.~1.44.~ Tue May 14 23:56:46 2002 +++ smtpmail.el Sun May 19 02:01:50 2002 @@ -832,10 +832,12 @@ (setq smtpmail-read-point (point)) ;; Escape "." at start of a line (if (eq (string-to-char data) ?.) - (process-send-string process ".")) - (process-send-string process data) - (process-send-string process "\r\n") - ) + (when (memq (process-status process) '(open run)) + (process-send-string process "."))) + (when (memq (process-status process) '(open run)) + (process-send-string process data)) + (when (memq (process-status process) '(open run)) + (process-send-string process "\r\n"))) (defun smtpmail-send-data (process buffer) (let @@ -847,7 +849,8 @@ (with-current-buffer buffer (goto-char (point-min))) - (while data-continue + (while (and data-continue + (memq (process-status process) '(open run))) (with-current-buffer buffer (beginning-of-line) (setq this-line (point)) @@ -859,6 +862,7 @@ (setq data-continue nil))) (smtpmail-send-data-1 process sending-data) + (accept-process-output process 0) ) ) ) Richard Stallman writes: > Can you do the right thing about this? Or if it is due to a problem > in Emacs primitives, could you explain the problem to us so someone > can try to fix it? > > From: Christoph Conrad > Subject: Re: Problem sending bigger mails with CVS Gnus + CVS Emacs > To: emacs-pretest-bug@gnu.org > Date: Fri, 17 May 2002 15:50:13 +0200 > Reply-to: cc@ivu-ac.de, christoph.conrad@gmx.de > Organization: Church of GNU Emacs > > In GNU Emacs 21.2.50.1 (i386-msvc-nt4.0.1381) > of 2002-05-17 on CLI119 > configured using `configure --with-msvc (12.00)' > Important settings: > value of $LC_ALL: nil > value of $LC_COLLATE: nil > value of $LC_CTYPE: nil > value of $LC_MESSAGES: nil > value of $LC_MONETARY: nil > value of $LC_NUMERIC: nil > value of $LC_TIME: nil > value of $LANG: DEU > locale-coding-system: iso-latin-1 > default-enable-multibyte-characters: nil > > I have some strange problem (and a workaround) with CVS Gnus and CVS > Emacs, both from today. > > When i try to send a mail which is a little bit bigger than about 40K > the following lines are in /var/log/mail > > ,---- > | May 17 13:14:11 cli3 sendmail[23841]: g4HBCja23841: collect: premature EOM: Error 0 > | May 17 13:14:11 cli3 sendmail[24045]: g4HBDxa24045: collect: unexpected close on connection from cli119.cli.de, sender=: Error 0 > `---- > > and Emacs reports: "writing to process, invalid argument, SMTP > > The workaround is to > > (defadvice smtpmail-send-data(around smtpmail-send-data-delay act) > (sleep-for 1) > ad-do-it) > > which simply makes a pause of 1 sec in smtpmail.el's code: > > ,---- > | ;; DATA > | (smtpmail-send-command process "DATA") > | > | (if (or (null (car (setq response-code (smtpmail-read-response process)))) > | (not (integerp (car response-code))) > | (>= (car response-code) 400)) > | (throw 'done nil) > | ) > | > | ;; !!!! here: wait 1 sec > | ;; Mail contents > | (smtpmail-send-data process smtpmail-text-buffer) > `---- > ----------