From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ken Olum Newsgroups: gmane.emacs.bugs Subject: bug#26918: 25.2; rmail edit corrupts mail if content-type header not displayed Date: Sat, 13 May 2017 21:38:52 -0400 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1494726014 3417 195.159.176.226 (14 May 2017 01:40:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 May 2017 01:40:14 +0000 (UTC) To: 26918@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 14 03:40:10 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 1d9iW1-0000kk-FH for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 May 2017 03:40:09 +0200 Original-Received: from localhost ([::1]:59407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9iW6-0004rP-HD for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 May 2017 21:40:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9iVy-0004q9-92 for bug-gnu-emacs@gnu.org; Sat, 13 May 2017 21:40:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9iVv-0001zu-4E for bug-gnu-emacs@gnu.org; Sat, 13 May 2017 21:40:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40755) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9iVv-0001ze-0u for bug-gnu-emacs@gnu.org; Sat, 13 May 2017 21:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d9iVt-0003lk-Pg for bug-gnu-emacs@gnu.org; Sat, 13 May 2017 21:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Olum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 May 2017 01:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26918 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.149472595214417 (code B ref -1); Sun, 14 May 2017 01:40:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 May 2017 01:39:12 +0000 Original-Received: from localhost ([127.0.0.1]:43432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9iV6-0003kT-Gc for submit@debbugs.gnu.org; Sat, 13 May 2017 21:39:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9iV4-0003kG-Jd for submit@debbugs.gnu.org; Sat, 13 May 2017 21:39:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9iUy-0001We-BS for submit@debbugs.gnu.org; Sat, 13 May 2017 21:39:05 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:45283) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d9iUy-0001Wa-8j for submit@debbugs.gnu.org; Sat, 13 May 2017 21:39:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9iUw-0004oN-3m for bug-gnu-emacs@gnu.org; Sat, 13 May 2017 21:39:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9iUt-0001TI-0z for bug-gnu-emacs@gnu.org; Sat, 13 May 2017 21:39:02 -0400 Original-Received: from cosmos.phy.tufts.edu ([130.64.84.253]:46509) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d9iUs-0001Lw-SI for bug-gnu-emacs@gnu.org; Sat, 13 May 2017 21:38:58 -0400 Original-Received: from kdo by cosmos.phy.tufts.edu ([local]:local) with local id 1d9iUm-0002NN-LW - Using Exim-4.84 (MandrivaLinux) MTA (return-path ); Sat, 13 May 2017 21:38:52 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:132491 Archived-At: --=-=-= Content-Type: text/plain 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. Ken In GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2017-05-13 built on neptune Windowing system distributor 'The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.5 LTS Configured features: XPM JPEG TIFF GIF PNG SOUND NOTIFY ZLIB TOOLKIT_SCROLL_BARS LUCID X11 Important settings: value of $LC_ALL: C value of $LANG: en_US.UTF-8 locale-coding-system: nil Major mode: Lisp Interaction Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t Recent messages: Loading /home/kdo/emacs-init.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu mail-prsvr mail-utils shell pcomplete comint ansi-color ring cl-macs cl gv cl-loaddefs pcase cl-lib warnings time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote inotify dynamic-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 95255 6032) (symbols 48 20728 0) (miscs 40 52 117) (strings 32 18042 4867) (string-bytes 1 512076) (vectors 16 13426) (vector-slots 8 443268 2725) (floats 8 169 6) (intervals 56 189 92) (buffers 976 18) (heap 1024 39178 767)) --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=rmail-test Content-Transfer-Encoding: base64 RnJvbSBrZG9AY29zbW9zLnBoeS50dWZ0cy5lZHUgU2F0IE1heSAxMyAyMDo1MjozNCAyMDE3ClJl dHVybi1wYXRoOiA8a2RvQGNvc21vcy5waHkudHVmdHMuZWR1PgpFbnZlbG9wZS10bzoga2RvQGNv c21vcy5waHkudHVmdHMuZWR1CkRlbGl2ZXJ5LWRhdGU6IFNhdCwgMTMgTWF5IDIwMTcgMjA6NTI6 MzQgLTA0MDAKUmVjZWl2ZWQ6IGZyb20ga2RvIGJ5IGNvc21vcy5waHkudHVmdHMuZWR1IChbbG9j YWxdOmxvY2FsKQoJd2l0aCBsb2NhbCBpZCAxZDlobHktMDAwMkNCLU02IC0gVXNpbmcgRXhpbS00 Ljg0IChNYW5kcml2YUxpbnV4KSBNVEEgCgkocmV0dXJuLXBhdGggPGtkb0Bjb3Ntb3MucGh5LnR1 ZnRzLmVkdT4pOyBTYXQsIDEzIE1heSAyMDE3IDIwOjUyOjM0IC0wNDAwCkZyb206IEtlbiBPbHVt IDxrZG9AY29zbW9zLnBoeS50dWZ0cy5lZHU+ClRvOiBrZG9AY29zbW9zLnBoeS50dWZ0cy5lZHUK U3ViamVjdDogCkRhdGU6IFNhdCwgMTMgTWF5IDIwMTcgMjA6NTI6MzQgLTA0MDAKTWVzc2FnZS1J RDogPHE1MjdmMWsxY3E1LmZzZkBjb3Ntb3MucGh5LnR1ZnRzLmVkdT4KTUlNRS1WZXJzaW9uOiAx LjAKQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFyc2V0PXV0Zi04CkNvbnRlbnQtVHJhbnNm ZXItRW5jb2Rpbmc6IGJhc2U2NApYLVJNQUlMLUFUVFJJQlVURVM6IC0tRS0tLS0tCgpWR2hwY3lC cGN5QmhJSFJsYzNRS0NnPT0= --=-=-=--