From unknown Mon Aug 18 20:13:52 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39580: 26.2; missing newline in fcc when output file is in an rmail buffer Resent-From: Ken Olum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Feb 2020 18:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39580 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 39580@debbugs.gnu.org Cc: kdo@cosmos.phy.tufts.edu X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158153303630471 (code B ref -1); Wed, 12 Feb 2020 18:44:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Feb 2020 18:43:56 +0000 Received: from localhost ([127.0.0.1]:59043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1wzL-0007vP-KD for submit@debbugs.gnu.org; Wed, 12 Feb 2020 13:43:55 -0500 Received: from lists.gnu.org ([209.51.188.17]:53086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1wzI-0007vE-Q2 for submit@debbugs.gnu.org; Wed, 12 Feb 2020 13:43:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55279) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1wzH-0001RJ-M9 for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2020 13:43:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1wzG-0003zt-Im for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2020 13:43:51 -0500 Received: from cosmos.phy.tufts.edu ([130.64.84.253]:44236) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j1wzG-0003v5-Fl for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2020 13:43:50 -0500 Received: from kdo by cosmos.phy.tufts.edu ([local]:local) with local id 1j1wzA-0003ol-64 - Using Exim-4.92.2 (MandrivaLinux) MTA (return-path ); Wed, 12 Feb 2020 13:43:44 -0500 From: Ken Olum Date: Wed, 12 Feb 2020 13:43:44 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 130.64.84.253 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) The function gnus-output-to-rmail fails to ensure a blank line at the end of the message being output in the case where the output file is an mbox file viewed in an rmail buffer. The needed code is in this function, but triggers only when the output file is not in a buffer. This causes messages in the output file to be merged together. To reproduce: emacs -Q C-x m to compose message edit outgoing message to add a line "Fcc: test-save" (for example) and some body that does not have a blank line at the end. C-c C-c to send message Visit "test-save" M-x rmail-mode Select buffer "*sent mail to ...*" C-c C-c to send message again File "test-save" is now corrupt because it lacks a blank line at the end. To see that it is corrupt: Send the same message yet again. Select the "test-save" buffer. It will look OK, but Kill the "test-save" buffer. Visit "test-save" again M-x rmail-mode Now the last two copies of the message will be concatenated into a single message. I propose fixing this by taking the code for inserting the blank line that starts "(unless babyl ; from gnus-output-to-mail" and moving it before ";; Decide whether to append to a file or to an Emacs buffer." so that it takes place for all mbox files. There is a similar bug in gnus-output-to-mail that occurs when the file is in a non-rmail buffer. It makes the same mistake, but corrects it next time by putting in another newline at the end of what it did before. However, it always adds the newline, so if the file is empty it corrupts it by putting an extra blank line at the front. Ken From unknown Mon Aug 18 20:13:52 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39580: 26.2; missing newline in fcc when output file is in an rmail buffer Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Oct 2020 18:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39580 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Olum Cc: 39580@debbugs.gnu.org Received: via spool by 39580-submit@debbugs.gnu.org id=B39580.160382248313590 (code B ref 39580); Tue, 27 Oct 2020 18:15:02 +0000 Received: (at 39580) by debbugs.gnu.org; 27 Oct 2020 18:14:43 +0000 Received: from localhost ([127.0.0.1]:45770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXTUY-0003X8-QY for submit@debbugs.gnu.org; Tue, 27 Oct 2020 14:14:43 -0400 Received: from quimby.gnus.org ([95.216.78.240]:60248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXTUW-0003Wv-UM for 39580@debbugs.gnu.org; Tue, 27 Oct 2020 14:14:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QBK2pxqGZXbxgTD73Csz3DWP2zfTK8CVuRobJ5WyhE8=; b=o5IPeKjDq38wgZ4xJA3sHyAylh gNtkpc3q4b0vttzYrnBJVMRcEGHsx3ig59yMrRLtg5oHYxGIXD99iPcxHE+0DNZgUhlUfbOCyxz9P WCIDwinsD+nWscg9zbNX4yf4+r+W+Z8bhARYw34wQLMLfAbYUlHasIk8CNhHgRFUxGbE=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXTUL-0002Gl-5P; Tue, 27 Oct 2020 19:14:34 +0100 From: Lars Ingebrigtsen References: X-Now-Playing: Vladislav Delay, Sly Dunbar, Robbie Shakespeare's _500-PUSH-UP_: "(519)" Date: Tue, 27 Oct 2020 19:14:27 +0100 In-Reply-To: (Ken Olum's message of "Wed, 12 Feb 2020 13:43:44 -0500") Message-ID: <87o8kn1qpo.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Ken Olum writes: > The function gnus-output-to-rmail fails to ensure a blank line at the > end of the message being output in the case where the output file is an > mbox file viewed in an rmail buffer. The needed code [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Ken Olum writes: > The function gnus-output-to-rmail fails to ensure a blank line at the > end of the message being output in the case where the output file is an > mbox file viewed in an rmail buffer. The needed code is in this > function, but triggers only when the output file is not in a buffer. > This causes messages in the output file to be merged together. > > To reproduce: > > emacs -Q > C-x m to compose message > edit outgoing message to add a line "Fcc: test-save" (for example) and > some body that does not have a blank line at the end. > C-c C-c to send message > Visit "test-save" > M-x rmail-mode > Select buffer "*sent mail to ...*" > C-c C-c to send message again > > File "test-save" is now corrupt because it lacks a blank line at the > end. I'm able to reproduce this bug, but I'm not sure how gnus-output-to-rmail is involved here? As far as I can see, it's never called by Message, and instead `message-output' is called to create the file. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Mon Aug 18 20:13:52 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39580: 26.2; missing newline in fcc when output file is in an rmail buffer Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Oct 2020 18:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39580 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Olum Cc: 39580@debbugs.gnu.org Received: via spool by 39580-submit@debbugs.gnu.org id=B39580.160382262220428 (code B ref 39580); Tue, 27 Oct 2020 18:18:02 +0000 Received: (at 39580) by debbugs.gnu.org; 27 Oct 2020 18:17:02 +0000 Received: from localhost ([127.0.0.1]:45778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXTWn-0005J9-GS for submit@debbugs.gnu.org; Tue, 27 Oct 2020 14:17:01 -0400 Received: from quimby.gnus.org ([95.216.78.240]:60272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXTWm-0005E0-00 for 39580@debbugs.gnu.org; Tue, 27 Oct 2020 14:17:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CH53lCCQviMdM5P3RGNJZXWX1mTIeA+rpo4wTYt9Suk=; b=S5A0g1NCHduoEUWRVu1tS0rylw dn/YnX8fcFIn6rv5R9s2X3lPNJBfVhyuZYIlkwaZE9xjpsuysRDWFUXduV0S51IHHrMPF4Y3YnvaP PuC1UacHAI+xqQgCR2d0/H1FogUyRFsBIVIJyhfkf/fJqt3uUS64hO/AxPaxOrn6/Fkg=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXTWd-0002Jm-KJ; Tue, 27 Oct 2020 19:16:54 +0100 From: Lars Ingebrigtsen References: <87o8kn1qpo.fsf@gnus.org> X-Now-Playing: Vladislav Delay, Sly Dunbar, Robbie Shakespeare's _500-PUSH-UP_: "(516)" Date: Tue, 27 Oct 2020 19:16:50 +0100 In-Reply-To: <87o8kn1qpo.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 27 Oct 2020 19:14:27 +0100") Message-ID: <87k0vb1qlp.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > I'm able to reproduce this bug, but I'm not sure how > gnus-output-to-rmail is involved here? As far as I can see, it's never > called by Message, and instead `message-output' is called to create th [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > I'm able to reproduce this bug, but I'm not sure how > gnus-output-to-rmail is involved here? As far as I can see, it's never > called by Message, and instead `message-output' is called to create the > file. Sorry; I see that message-output calls that function in some circumstances... but not by default; only if the file is on babyl format? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Mon Aug 18 20:13:52 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39580: 26.2; missing newline in fcc when output file is in an rmail buffer Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Oct 2020 18:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39580 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Olum Cc: 39580@debbugs.gnu.org Received: via spool by 39580-submit@debbugs.gnu.org id=B39580.160382340723275 (code B ref 39580); Tue, 27 Oct 2020 18:31:01 +0000 Received: (at 39580) by debbugs.gnu.org; 27 Oct 2020 18:30:07 +0000 Received: from localhost ([127.0.0.1]:45812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXTjT-00063L-F7 for submit@debbugs.gnu.org; Tue, 27 Oct 2020 14:30:07 -0400 Received: from quimby.gnus.org ([95.216.78.240]:60402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXTjP-00061y-LO for 39580@debbugs.gnu.org; Tue, 27 Oct 2020 14:30:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=d5UkJzHpoNPzKeP2RAJzbfQwDWdEA6N1YaczvtD35h8=; b=NzhNWKyzjoAZjgOtj0bQyTXDDV L1jt8mDmRyYOErnUbFi6bET9s2sPX/tQ3uzQs2ijse/yda8VFJVAYMP/TgyinsR8ZEvg5bGHHqsV8 4xhwT+mQKr/vOrEFlqiLVFBRweUdowoMYXhqYIHXFoP3x8y40vQ7wv37y1orjV7RS3K8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXTjF-0002Qh-Rz; Tue, 27 Oct 2020 19:29:57 +0100 From: Lars Ingebrigtsen References: <87o8kn1qpo.fsf@gnus.org> <87k0vb1qlp.fsf@gnus.org> X-Now-Playing: Zola Jesus's _Live at Roadburn_: "Veka" Date: Tue, 27 Oct 2020 19:29:52 +0100 In-Reply-To: <87k0vb1qlp.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 27 Oct 2020 19:16:50 +0100") Message-ID: <87ft5z1pzz.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > Lars Ingebrigtsen writes: > >> I'm able to reproduce this bug, but I'm not sure how >> gnus-output-to-rmail is involved here? As far as I can see, it's never >> called by Message, a [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > Lars Ingebrigtsen writes: > >> I'm able to reproduce this bug, but I'm not sure how >> gnus-output-to-rmail is involved here? As far as I can see, it's never >> called by Message, and instead `message-output' is called to create the >> file. > > Sorry; I see that message-output calls that function in some > circumstances... but not by default; only if the file is on babyl > format? I was even more confused here -- your recipe included all the elements necessary to reproduce all parts of the bug, but I just didn't read it correctly. I've now fixed this bug in Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 27 14:30:13 2020 Received: (at control) by debbugs.gnu.org; 27 Oct 2020 18:30:13 +0000 Received: from localhost ([127.0.0.1]:45815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXTjY-00064c-Sb for submit@debbugs.gnu.org; Tue, 27 Oct 2020 14:30:13 -0400 Received: from quimby.gnus.org ([95.216.78.240]:60418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXTjW-00063F-An for control@debbugs.gnu.org; Tue, 27 Oct 2020 14:30:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CWgXUIl5Q4JewG555jjvTda+bBH5jQ08oAIMvpTTyqs=; b=F3Flbutu+jNImjMWmsDGUPG/99 VgdQl7+XEmxKOnI8cVANmVyZZzg5qhyxcxvy7CCiVfqVBBXbXJ5+SRYBLgZ/m+Gwc8WL+CKqJyI+g U6fzZQUcfMvd8LkWnHiGAHYnfSkEQdu0x0JGrs60UIrlP8p/qpSMfomwrbCex7nVHLnY=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXTjO-0002Qq-Lj for control@debbugs.gnu.org; Tue, 27 Oct 2020 19:30:04 +0100 Date: Tue, 27 Oct 2020 19:30:01 +0100 Message-Id: <87eelj1pzq.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #39580 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 39580 fixed close 39580 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 39580 fixed close 39580 28.1 quit