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: sendmail.el bug or expected behavior? Date: Mon, 26 Jan 2004 17:21:24 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <877jzn2lk8.fsf@raven.i.defaultvalue.org> <16405.8086.195634.248486@chiark.greenend.org.uk> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1075135414 1677 80.91.224.253 (26 Jan 2004 16:43:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Jan 2004 16:43:34 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Jan 26 17:43:30 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Al9pi-0007mr-00 for ; Mon, 26 Jan 2004 17:43:30 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Al9pi-0001X0-00 for ; Mon, 26 Jan 2004 17:43:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Al9dx-00047k-EB for emacs-devel@quimby.gnus.org; Mon, 26 Jan 2004 11:31:21 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Al9XY-0002O2-Bv for emacs-devel@gnu.org; Mon, 26 Jan 2004 11:24:44 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Al9Uu-0000wC-Aa for emacs-devel@gnu.org; Mon, 26 Jan 2004 11:22:33 -0500 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Al9Us-0000v6-TJ for emacs-devel@gnu.org; Mon, 26 Jan 2004 11:21:59 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1Al9Ur-0002qD-00 for ; Mon, 26 Jan 2004 17:21:57 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Al9Up-0002q5-00 for ; Mon, 26 Jan 2004 17:21:55 +0100 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1Al9Up-0007y0-00 for ; Mon, 26 Jan 2004 17:21:55 +0100 Original-Lines: 30 Original-X-Complaints-To: usenet@sea.gmane.org User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:JTYU/4NCsOIulg79Rg+jP7lnl9k= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19492 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19492 I see much discussion, but few solutions. Here is one idea (I can't implement this now, but since I thought about the problem briefly, I reckoned I should write it down somewhere): The actual problem that users actually encounter seem to be when `sendmail-program' points to a non-existing, a non-executable, or a non-conforming (i.e., it rejects a command line parameter or exit immediately because of invalid configuration file) application. I think all of these cases can be detected, without negatively affecting proper operation, by using start-process instead of call-process with BUFFER=0. The code would spawn the process, poll the process for, e.g., 1 second, and if it is still running, continue. If it returns with a fatal error code within 1 second, report that to the user. One potential problem would be that if sendmail is still running when emacs is about to quit, then the process should not be killed. How can you achieve that? There is process-kill-without-query, but a process-forget-without-query would be needed here. E.g., replace (setq foo (call-process ... 0 ...)) with (setq foo (start-process ...)) (sit-for 1) (unless (eq 0 (process-exit-status foo)) (error "Invoking sendmail failed..."))