From: Ken Olum <kdo@cosmos.phy.tufts.edu>
To: 26918@debbugs.gnu.org
Subject: bug#26918: 25.2; rmail edit corrupts mail if content-type header not displayed
Date: Sat, 13 May 2017 21:38:52 -0400 [thread overview]
Message-ID: <q521srs1akz.fsf@cosmos.phy.tufts.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 3898 bytes --]
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))
[-- Attachment #2: rmail-test --]
[-- Type: application/octet-stream, Size: 701 bytes --]
From kdo@cosmos.phy.tufts.edu Sat May 13 20:52:34 2017
Return-path: <kdo@cosmos.phy.tufts.edu>
Envelope-to: kdo@cosmos.phy.tufts.edu
Delivery-date: Sat, 13 May 2017 20:52:34 -0400
Received: from kdo by cosmos.phy.tufts.edu ([local]:local)
with local id 1d9hly-0002CB-M6 - Using Exim-4.84 (MandrivaLinux) MTA
(return-path <kdo@cosmos.phy.tufts.edu>); Sat, 13 May 2017 20:52:34 -0400
From: Ken Olum <kdo@cosmos.phy.tufts.edu>
To: kdo@cosmos.phy.tufts.edu
Subject:
Date: Sat, 13 May 2017 20:52:34 -0400
Message-ID: <q527f1k1cq5.fsf@cosmos.phy.tufts.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64
X-RMAIL-ATTRIBUTES: --E-----
VGhpcyBpcyBhIHRlc3QKCg==
next reply other threads:[~2017-05-14 1:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-14 1:38 Ken Olum [this message]
2017-06-05 21:16 ` bug#26918: 25.2; rmail edit corrupts mail if content-type header not displayed Glenn Morris
2017-06-06 15:06 ` Ken Olum
2017-06-08 18:10 ` Glenn Morris
2017-06-19 18:40 ` bug#26918: rmail-cease-edit patches for bugs 26918 and 27353 Ken Olum
2017-09-08 9:11 ` bug#27353: " Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=q521srs1akz.fsf@cosmos.phy.tufts.edu \
--to=kdo@cosmos.phy.tufts.edu \
--cc=26918@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).