From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Armstrong Newsgroups: gmane.emacs.bugs Subject: bug#56855: 27.1; sendmail-send-it considers it an error if sendmail wrote to stdout/stderr Date: Mon, 01 Aug 2022 13:46:15 -0700 Message-ID: <87o7x34rqg.fsf@rfc20.org> References: <87wnbtig4z.fsf@thinkbox> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39407"; mail-complaints-to="usenet@ciao.gmane.io" To: Justus Winter , 56855@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 01 22:47:24 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIcJu-0009xI-RS for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Aug 2022 22:47:22 +0200 Original-Received: from localhost ([::1]:41202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIcJt-00050m-Mm for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Aug 2022 16:47:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIcJa-00050O-GV for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2022 16:47:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIcJa-0008Ca-7P for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2022 16:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIcJa-0003N3-0V for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2022 16:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matt Armstrong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Aug 2022 20:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56855 X-GNU-PR-Package: emacs Original-Received: via spool by 56855-submit@debbugs.gnu.org id=B56855.165938678812905 (code B ref 56855); Mon, 01 Aug 2022 20:47:01 +0000 Original-Received: (at 56855) by debbugs.gnu.org; 1 Aug 2022 20:46:28 +0000 Original-Received: from localhost ([127.0.0.1]:41713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIcJ2-0003M4-8w for submit@debbugs.gnu.org; Mon, 01 Aug 2022 16:46:28 -0400 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:52441) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIcIy-0003Ln-Vb for 56855@debbugs.gnu.org; Mon, 01 Aug 2022 16:46:27 -0400 Original-Received: (Authenticated sender: matt@rfc20.org) by mail.gandi.net (Postfix) with ESMTPSA id D0C96200003; Mon, 1 Aug 2022 20:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rfc20.org; s=gm1; t=1659386778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NDA/RXd3zXmhwTFpx58jCdi5xEfgwjFvqMmT0ruC1+A=; b=L3ON0E0C1BEUbfCAwjoTBgfoNbRo0+h4IjSJkNeNpnM+LqJow/cu/3/ji6Zlt9dTLSc0GU xSme28sxEl7Sp7/znbMevC2YUpQvKvpJnidwi8RY3m7LDBg0PQuCjUVosBtW7bRH7Eps9c znxQnSZuLfj0WUMGagOPO6OsFIFdaEfQLqtBBxUCsLIhMtz4QrNQ59qrPIgBUaMIrH4MSK BbSg89R1mpAzQZpRITrmGALTdi4fdr+qByy0/vucNTc4CjRVI1UxnSerxAVAgGIFuwJ5D3 sG84wrBtKygYtqYS/1qQmRSnHlKrAeS4FISqlzqNa4MraWFhPdqBHE1c0gfg0A== Original-Received: from matt by naz with local (Exim 4.96) (envelope-from ) id 1oIcIp-00176S-0K; Mon, 01 Aug 2022 13:46:15 -0700 In-Reply-To: <87wnbtig4z.fsf@thinkbox> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:238467 Archived-At: Justus Winter writes: > sendmail-send-it considers it an error if sendmail wrote to > stdout/stderr, despite the fact that the process returned success. [...] > I read documentation of various sendmail implementations, and all > agreed that returning success meant that the operation succeeded. I > found no justification for emacs thinking that the operation failed if > the process printed to stdout or stderr. This is perhaps surprising. It is also behavior that has come to be expected, especially in more traditional Unix programs. E.g. crontab also considers jobs that print to stderr to have an error, regardless of exit status. >From the sendmail(8) manpage we have this statement: Sendmail is not intended as a user interface routine; other programs provide user-friendly front ends; sendmail is used only to deliver pre-formatted messages. An implementation of the "sendmail program" should probably emulate the original sendmail as closely as possible. It prints no messages when it succeeds. On this we do have roughly 35 years of historical precedent, since the original Sendmail began in the mid-80s. :-) This may seem like a historical wart, but I have personally found this behavior to be helpful, especially in programs that are typically run non-interactively and "out of sight" like a crontab or sendmail wrapper script. E.g. when a shell script prints to stderr there may indeed have been a problem, but a bug in the script may still have caused it to exit with zero regardless. It is usually easy to arange for such programs to print nothing when they succeed. > I use msmtp with the authentication password encrypted using OpenPGP. > Then, I use 'gpg --no-tty -q -d ...' as msmtp's passwordeval function. > Now, my OpenPGP key has expired, but that doesn't stop GnuPG from > decrypting the secret, and in fact it returns the status code 0. It > also prints > > gpg: Note: secret key 08CC70F8D8CC765A expired at Mon 25 Jul 2022 05:31:26 PM CEST > > to stderr, which is picked up by emacs, it says > > sending...failed to gpg: Note: secret key 08CC70F8D8CC765A expired at Mon 25 Jul 2022 05:31:26 PM CEST > > in the status buffer while the compose buffer stays open. Note that > despite this, the message has been sent successfully, while emacs > indicates that the sending has failed. Can you configure your msmtp to behave like sendmail and refrain from printing human readable messages upon success? Perhaps the --logger-fd or --logger-file arguments to gpg could be used to direct the output you do not wish to read to /dev/null?