From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 17 11:55:29 2012 Received: (at submit) by debbugs.gnu.org; 17 Dec 2012 16:55:29 +0000 Received: from localhost ([127.0.0.1]:47368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkdyR-0004Jr-KY for submit@debbugs.gnu.org; Mon, 17 Dec 2012 11:55:28 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37656) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkdJx-0003Ku-71 for submit@debbugs.gnu.org; Mon, 17 Dec 2012 11:13:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkdIa-0004Y4-V0 for submit@debbugs.gnu.org; Mon, 17 Dec 2012 11:12:21 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:44855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkdIa-0004Xz-R5 for submit@debbugs.gnu.org; Mon, 17 Dec 2012 11:12:12 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkdIV-0002Kv-To for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2012 11:12:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkdIP-0004Vf-Ht for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2012 11:12:07 -0500 Received: from qmta12.westchester.pa.mail.comcast.net ([2001:558:fe14:44:76:96:59:227]:50322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkdIP-0004P6-8x for bug-gnu-emacs@gnu.org; Mon, 17 Dec 2012 11:12:01 -0500 Received: from omta01.westchester.pa.mail.comcast.net ([76.96.62.11]) by qmta12.westchester.pa.mail.comcast.net with comcast id cdFh1k0060EZKEL5CfmjAS; Mon, 17 Dec 2012 15:46:43 +0000 Received: from freeze.ariadne.com ([24.34.72.61]) by omta01.westchester.pa.mail.comcast.net with comcast id cfmj1k00g1KKtkw3MfmjQN; Mon, 17 Dec 2012 15:46:43 +0000 Received: from freeze.ariadne.com (freeze.ariadne.com [127.0.0.1]) by freeze.ariadne.com (8.14.5/8.14.5) with ESMTP id qBHFkgmf008623; Mon, 17 Dec 2012 10:46:43 -0500 Received: (from worley@localhost) by freeze.ariadne.com (8.14.5/8.14.5/Submit) id qBHFkgKj008622; Mon, 17 Dec 2012 10:46:42 -0500 Date: Mon, 17 Dec 2012 10:46:42 -0500 Message-Id: <201212171546.qBHFkgKj008622@freeze.ariadne.com> From: worley@alum.mit.edu (Dale R. Worley) To: bug-gnu-emacs@gnu.org Subject: 23.3; RMAIL rmail-edit-current-message damages MIME messages DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1355759203; bh=we4xMZ5dH+wGpMM5uTINJ3e60CrZ3QZ4wC4nG/iriRY=; h=Received:Received:Received:Received:Date:Message-Id:From:To: Subject; b=R/Uoiu1XA8DT7xTxfjujqgUCbI8XtQL47pGnI34779faOHBZ1X+JjYmtTbzjIwRqJ PpkBcJHJQe5SkFeF4iUpZAkGOKq2kCHxkIza6Qipj1DBoqOPhqy1cAHc8yjyQjlDpl Oh17rGk9BnuETlxAiKHdvzpi8ZDgykBs3IqkV/Cj+0zOdMwWaPPaoa5hFvlf4EDciO /jsyu6MBi9Mb3Z+C5g0p7V3Eqp709var6n3UOIqGagC+kOsuQaN0H3rDMEQ3IeLqLz Qp2jl7IEdP1A2X8xj3S2ES6edPUoICcHi8iHi854RnL9/1HHSp8zb1o3Rqft26sxzl tcMz2OA5WYtkw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 17 Dec 2012 11:55:26 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) ----- Summary: In RMAIL, if a message is a MIME message that is not just a text/plain, executing rmail-edit-current-message (`e') on the message destroys its contents, even if no changes are made before exiting (with `C-c C-c'). A simple change to block rmail-edit-current-message on MIME messages is proposed. Emacs version: GNU Emacs 23.3.1 (i686-redhat-linux-gnu, GTK+ Version 2.24.8) of 2012-11-17 on buildvm-19.phx2.fedoraproject.org This is current for "Fedora release 16 (Verne)". How to reproduce: Create a mail file containing a MIME multipart message. Open the file with RMAIL and select the message. The resulting display is something like this: Date: Mon, 17 Dec 2012 09:47:08 -0500 From: Dale Worley To: worley@freeze.ariadne.com Subject: Test 1 [1:text/plain Hide] Test 1 [2:image/jpeg Show Save:airplant.jpeg (282kB)] Edit the message by typing `e', moving the cursor to after "Test 1", then adding some text. The resulting display is: Date: Mon, 17 Dec 2012 09:47:08 -0500 From: Dale Worley To: worley@freeze.ariadne.com Subject: Test 1 [1:text/plain Hide] Test 1 More text. [2:image/jpeg Show Save:airplant.jpeg (282kB)] Type `C-c C-c' to exit rmail-edit mode. Save the file with `C-x C-s'. Now open the mail file literally and find the message that you edited. What you will see is that the message's body is now what was *displayed* for it during the editing session. For example: From worley@c-66-31-108-177.hsd1.ma.comcast.net Mon Dec 17 09:47:08 2012 Return-Path: Received: from freeze.ariadne.com (freeze.ariadne.com [127.0.0.1]) by freeze.ariadne.com (8.14.5/8.14.5) with ESMTP id qBHEl8OO007938 for ; Mon, 17 Dec 2012 09:47:08 -0500 Received: (from worley@localhost) by freeze.ariadne.com (8.14.5/8.14.5/Submit) id qBHEl8Tp007937; Mon, 17 Dec 2012 09:47:08 -0500 Date: Mon, 17 Dec 2012 09:47:08 -0500 Message-Id: <201212171447.qBHEl8Tp007937@freeze.ariadne.com> From: Dale Worley To: worley@freeze.ariadne.com Subject: Test 1 Content-type: text/plain; charset=us-ascii Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------make-mime-1355755615-7926" X-Attachments: airplant.jpeg; X-RMAIL-ATTRIBUTES: --E----- [1:text/plain Hide] Test 1 More text. [2:image/jpeg Show Save:airplant.jpeg (282kB)] In this case, the image/jpeg component is irreversably lost. Proposed partial fix: The following change prevents rmail-edit from being invoked on a message if it is a MIME message, except when the entire body is text/plain: (defun rmail-edit-current-message () "Edit the contents of this message." (interactive) (if (zerop rmail-total-messages) (error "No messages in this buffer")) + ;; If the message is MIME, only edit it if the whole body is text/plain. + ;; (This depends on the particular return value of (rmail-mime-message-p).) + (let ((mm (rmail-mime-message-p))) + (if (and mm + (not (string-equal (car (rmail-mime-entity-type mm)) + "text/plain"))) + (error "Non-text MIME messages cannot be edited"))) (rmail-modify-format) ... This change also blocks invocation of rmail-edit from the rmail-summary buffer under the same circumstances. This change is deficient in that it depends on the return value of rmail-mime-message-p, which is only specified as nil vs. non-nil. (There may be a better function to call for this information than rmail-mime-message-p.) A better change would allow the user to edit MIME messages when they are displayed in "raw" mode (as a consequence of the `v' command). A much better change would allow the user to edit text components of MIME messaegs, preserving the non-text components. ----- In GNU Emacs 23.3.1 (i686-redhat-linux-gnu, GTK+ Version 2.24.8) of 2012-11-17 on buildvm-19.phx2.fedoraproject.org Windowing system distributor `Fedora Project', version 11.0.11104000 configured using `configure '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=i686-redhat-linux-gnu' 'host_alias=i686-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' 'LDFLAGS=-Wl,-z,relro '' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: C value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Fundamental Minor modes in effect: shell-dirtrack-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t Recent input: a n g e SPC w o u l d SPC a l l o w SPC t h e SPC u s e r SPC t o SPC e d i t SPC t e x t SPC c o m p o n e n t s SPC o f SPC M I M E SPC m e s s a e g s , SPC p r e s e r v i c n g SPC t C-a C-o C-o A SPC b e t t e r SPC c h a n g e SPC w o u l d SPC a l l o w SPC t h e SPC u s e r SPC t o SPC e d i t SPC M I M E S-SPC m e s s a g e s SPC a s SPC l o n w h e n SPC t h e y SPC w e a r e SPC d i s p l a y e d SPC i n SPC " r a w " SPC m o d e SPC ( a s SPC a SPC c o n s e q u e n c e SPC o f SPC t h e SPC ` v ' SPC c o m m a n d ) . M-q C-n C-n M-q C-n h e SPC n o n - t e x t SPC c o m p o n e n t s . M-< M-> C-x s C-x b * i SPC M-< C-s b u g C-a C-n C-x 5 2 M-x r e p o r t - e m a Recent messages: Replaced 4 occurrences Mark set [2 times] Auto-saving...done Mark set Auto-saving...done Mark set [2 times] (No files need saving) Auto-saving... Mark set Mark saved where search started Load-path shadows: /home/worley/emacs/rmail-spam-filter hides /usr/share/emacs/23.3/lisp/mail/rmail-spam-filter Features: (shadow emacsbug tabify noutline outline easy-mmode edmacro kmacro debug help-fns rmailedit rmailout help-mode view jka-compr info mule-util dired-aux dired rmailsum cookie1 ispell newcomment rmailmm cl cl-19 mailalias message sendmail ecomplete rfc822 mml easymenu mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mailabbrev nnheader gnus-util netrc gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash mail-parse rfc2231 rmail rfc2047 rfc2045 ietf-drums time-date qp mm-util mail-prsvr mail-utils multi-isearch shell comint ring cc-styles cc-align cc-engine cc-vars cc-defs regexp-opt tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 17 12:05:03 2012 Received: (at 13209) by debbugs.gnu.org; 17 Dec 2012 17:05:03 +0000 Received: from localhost ([127.0.0.1]:47409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tke7f-0004aS-5C for submit@debbugs.gnu.org; Mon, 17 Dec 2012 12:05:03 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:48297) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tke7a-0004aG-Je for 13209@debbugs.gnu.org; Mon, 17 Dec 2012 12:04:58 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Tke6L-0005FS-3A; Mon, 17 Dec 2012 12:03:37 -0500 From: Glenn Morris To: worley@alum.mit.edu (Dale R. Worley) Subject: Re: bug#13209: 23.3; RMAIL rmail-edit-current-message damages MIME messages References: <201212171546.qBHFkgKj008622@freeze.ariadne.com> X-Spook: colonel [Hello to all my friends and fans in domestic X-Ran: ';pJTma@6n1\*)DOBCfJ?p5)"jTFO+g>E>NG"mI`m]s!S8dD66KRtb8ioGL)S:tCAo68dJ X-Hue: red X-Attribution: GM Date: Mon, 17 Dec 2012 12:03:36 -0500 In-Reply-To: <201212171546.qBHFkgKj008622@freeze.ariadne.com> (Dale R. Worley's message of "Mon, 17 Dec 2012 10:46:42 -0500") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13209 Cc: 13209@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) Dale R. Worley wrote: > In RMAIL, if a message is a MIME message that is not just a > text/plain, executing rmail-edit-current-message (`e') on the message > destroys its contents, even if no changes are made before exiting > (with `C-c C-c'). Thanks for report. This was fixed in Emacs 24.1. http://debbugs.gnu.org/9840 > GNU Emacs 23.3.1 (i686-redhat-linux-gnu, GTK+ Version 2.24.8) of 2012-11-17 on buildvm-19.phx2.fedoraproject.org From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 17 12:05:15 2012 Received: (at control) by debbugs.gnu.org; 17 Dec 2012 17:05:15 +0000 Received: from localhost ([127.0.0.1]:47412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tke7u-0004b8-AK for submit@debbugs.gnu.org; Mon, 17 Dec 2012 12:05:14 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:48303) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tke7t-0004b2-7l for control@debbugs.gnu.org; Mon, 17 Dec 2012 12:05:13 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Tke6f-0005HW-7F for control@debbugs.gnu.org; Mon, 17 Dec 2012 12:03:57 -0500 Date: Mon, 17 Dec 2012 12:03:57 -0500 Message-Id: Subject: control message for bug 13209 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) unarchive 9840 forcemerge 9840 13209 From unknown Sat Jun 21 10:46:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 15 Jan 2013 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator