From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#26918: 25.2; rmail edit corrupts mail if content-type header not displayed Date: Mon, 05 Jun 2017 17:16:56 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1496697490 18448 195.159.176.226 (5 Jun 2017 21:18:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Jun 2017 21:18:10 +0000 (UTC) User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) Cc: 26918@debbugs.gnu.org To: Ken Olum Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 05 23:18:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHzO2-0004aQ-W1 for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jun 2017 23:18:07 +0200 Original-Received: from localhost ([::1]:35204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHzO8-0001DT-AM for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jun 2017 17:18:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHzNz-0001CB-DH for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2017 17:18:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHzNy-00031S-FF for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2017 17:18:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55473) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHzNy-00031K-BO for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2017 17:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dHzNy-0005bb-64 for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2017 17:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Jun 2017 21:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26918 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26918-submit@debbugs.gnu.org id=B26918.149669743321482 (code B ref 26918); Mon, 05 Jun 2017 21:18:02 +0000 Original-Received: (at 26918) by debbugs.gnu.org; 5 Jun 2017 21:17:13 +0000 Original-Received: from localhost ([127.0.0.1]:58150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHzNB-0005aP-23 for submit@debbugs.gnu.org; Mon, 05 Jun 2017 17:17:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dHzN9-0005a9-5K for 26918@debbugs.gnu.org; Mon, 05 Jun 2017 17:17:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHzN3-0002Sb-32 for 26918@debbugs.gnu.org; Mon, 05 Jun 2017 17:17:05 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHzMw-0002QD-Hi; Mon, 05 Jun 2017 17:16:58 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1dHzMu-0004CP-QC; Mon, 05 Jun 2017 17:16:56 -0400 X-Spook: Enriched Disaster medical assistance team Reyosa Armani X-Ran: 1u\Vt_k,Aaf67cqvYlnatYXi2L9yZOq;Gg6"L_.&|B*N#0[M)&(VU4Nsp@`Bc)??TU`FuL X-Hue: black X-Attribution: GM In-Reply-To: (Ken Olum's message of "Sat, 13 May 2017 21:38:52 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133322 Archived-At: Ken Olum wrote: > If you have a message in rmail which is in MIME format with base64 > encoding and consists only of a single text/plain part, and if you do > not display the "Content-Type" header (e.g. by having it in > rmail-ignored-headers), the message will get corrupted. The problem is > this: under the circumstances above, rmail-edit-current-message allows > you to edit your view of the message (which is good, since you don't > want to edit the base64). But when it goes to reencode the message, it > looks in the headers it gave you to edit and doesn't see the > Content-Type. Later it does see the Content-Type in the original > headers, and the result is massive confusion. In some circumstances it > corrupts only that message, but in others it corrupts your mail file by > merging this message with the one before. > > To reproduce: > > 1. emacs -Q > > 2. Visit attached rmail-test file > > 3. M-x rmail-mode > > 4. Set variable rmail-ignored-headers to ignore "Content-Type", e.g., by > editing it in customization system. > > 5. Push "t" twice so that previous change takes effect. Verify that > Content-Type is not displayed. > > 6. Push "e" to edit message. Insert a character at the end. C-c C-c to > finish. > > 7. Observe corrupted message on screen > > I'm not sure how to reproduce the situation where it corrupts your mail > file, but it has happened to me several times. > > I can provide a fix for this bug if we agree on the right strategy. It seems neither rmail user has an opinion. ;) What do you suggest? Two ideas that come to mind are: 1) force the relevant header(s) to be visible when editing a message 2) if the headers are not found in the message as edited, consult the full unswapped message. (I wonder what happens if an edit adds a new, duplicate Content-Type header that disagrees with the pre-existing one...)