From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Lillibridge Newsgroups: gmane.emacs.bugs Subject: bug#9521: PATCH for bug #9521, *not* bug #9766 Date: Fri, 28 Dec 2012 12:46:33 -0800 Message-ID: <87vcbl9a6u.fsf@foil.strangled.net> References: Reply-To: mdl@alum.mit.edu NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1356727641 13102 80.91.229.3 (28 Dec 2012 20:47:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Dec 2012 20:47:21 +0000 (UTC) To: 9521@debbugs.gnu.org, 9766@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 28 21:47:36 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Togq7-0004tU-Cb for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Dec 2012 21:47:35 +0100 Original-Received: from localhost ([::1]:43934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Togps-0006sK-S9 for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Dec 2012 15:47:20 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Togpl-0006q2-Tn for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:47:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Togpf-0007wr-JR for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:47:13 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Togpf-0007wn-FD for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:47:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TogqX-0003wx-MG for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mark Lillibridge Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Dec 2012 20:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9521-submit@debbugs.gnu.org id=B9521.135672765815143 (code B ref 9521); Fri, 28 Dec 2012 20:48:01 +0000 Original-Received: (at 9521) by debbugs.gnu.org; 28 Dec 2012 20:47:38 +0000 Original-Received: from localhost ([127.0.0.1]:35200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Togq9-0003wB-Qv for submit@debbugs.gnu.org; Fri, 28 Dec 2012 15:47:38 -0500 Original-Received: from alum-mailsec-scanner-6.mit.edu ([18.7.68.18]:53323) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Togq7-0003w0-77; Fri, 28 Dec 2012 15:47:36 -0500 X-AuditID: 12074412-b7f216d0000008e3-78-50de05304b02 Original-Received: from outgoing-alum.mit.edu (OUTGOING-ALUM.MIT.EDU [18.7.68.33]) by alum-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP id 56.C7.02275.0350ED05; Fri, 28 Dec 2012 15:46:40 -0500 (EST) Original-Received: from foil.strangled.net (c-67-188-235-212.hsd1.ca.comcast.net [67.188.235.212]) (authenticated bits=0) (User authenticated as mdl@ALUM.MIT.EDU) by outgoing-alum.mit.edu (8.13.8/8.12.4) with ESMTP id qBSKkbBa005834 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 28 Dec 2012 15:46:39 -0500 In-Reply-To: <871uea9dzk.fsf@foil.strangled.net> (message from Mark Lillibridge on Fri, 28 Dec 2012 11:24:31 -0800) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprOKsWRmVeSWpSXmKPExsUixO6iqGvAei/A4O4nDouJe3ezWixp28du MfXjGTYHZo+/7z8weVyctI85gCmK2yYpsaQsODM9T98ugTtj0yyDgpPqFTM+tDI1MG6U72Lk 5JAQMJGYffsfM4QtJnHh3nq2LkYuDiGBy4wSJ05/ZYFwrjJJNJ2eDFbFJqApMf3Zd3YQW0RA T+LTrAdgtrCArsT7aXMYQWxOgWKJlyc/sYHYQgJSEksXnQCrYRFQlZjds4K1i5GDg1dAX+L6 D7AjeAUEJU7OfMICYjMDhWdP72adwMg7C0lqFpIUhC0ucX3Vf+ZZQJOYBaQllv/jgAhrSyxb +Jp5ASPrKka5xJzSXN3cxMyc4tRk3eLkxLy81CJdM73czBK91JTSTYyQwBTawbj+pNwhRgEO RiUe3lO37wYIsSaWFVfmHmKU5GBSEuU9zngvQIgvKT+lMiOxOCO+qDQntfgQowQHs5IIr9Q/ oHLelMTKqtSifJiUNAeLkjjvz8XqfkIC6YklqdmpqQWpRTBZGQ4OJQleAxagoYJFqempFWmZ OSUIaSYOTpDhXFIixal5KalFiaUlGfGgaIwvBsYjSIoHaG84SDtvcUFiLlAUovUUoyXHlhc3 njJy/PgDIn+tvPmUUYglLz8vVUqcVxmkQQCkIaM0D24dLD29YhQH+l6Y1xWkigeY2uCmvgJa yAS00JrnDsjCkkSElFQDY//+jU9D/n5r2mzJU5i65kRu7xanmVvbSh09dVx7J/pwafRb5E2s iQn7l8zq+upGePXHvl/17tn71tvvaWo8OMt1mVBB9nHn1aZ8e4S8L+R2x6/zzm9f X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:69126 Archived-At: --=-=-= This bug (#9521) was easy to fix. The problem was with the rmail-insert-mime-forwarded-message function in rmailmm.el:1355: (defun rmail-insert-mime-forwarded-message (forward-buffer) "Insert the message in FORWARD-BUFFER as a forwarded message. This is the usual value of `rmail-insert-mime-forwarded-message-function'." (let ((message-buffer (with-current-buffer forward-buffer (if rmail-buffer-swapped forward-buffer rmail-view-buffer)))) (save-restriction (narrow-to-region (point) (point)) (message-forward-make-body-mime message-buffer)))) This does exactly the wrong thing by inserting the decoded version of the message. Swapping the two buffers (forward-buffer, rmail-view-buffer) in the if expression fixes this: (defun rmail-insert-mime-forwarded-message (forward-buffer) "Insert the message in FORWARD-BUFFER as a forwarded message. This is the usual value of `rmail-insert-mime-forwarded-message-function'." (let ((message-buffer (with-current-buffer forward-buffer (if rmail-buffer-swapped > rmail-view-buffer > forward-buffer)))) (save-restriction (narrow-to-region (point) (point)) (message-forward-make-body-mime message-buffer)))) Note that this does not fix bug #9766, which was incorrectly merged with bug #9521. The problem there (#9766) is that many email clients including in particular, the iPad email app, do not properly display RFC822 attachments or do not show it inline. Fixing that problem requires substantial work, including on the design front. One idea would be to generate the RFC822 attachment as now, which preserves the full details of the message for competent email clients, and also generate an abbreviated version in the message body for human viewers of incompetent email clients. The simplest approach would be to just insert the Rmail decoded version: ====== forwarded message as seen by sender (full message attached) ==== From: Kenichi Handa m17n.org> To: handa m17n.org Subject: test from shatin Date: Thu, 15 Sep 2011 14:14:58 +0900 Message-ID: <87aaa6xu7h.fsf m17n.org> Content-Type: multipart/mixed; boundary="=-=-=" [1:text/plain Hide] test of attachment [2:application/pdf Show Save:temp.pdf (2kB)] Here, the message headers have been filtered by the users usual header filtering rules and the body is as seen when the forwarding was done. e.g., whatever message part toggling the user did is still visible. Drawbacks: the PDF attachment here is not accessible to the incompetent email clients, this approach fails miserably for HTML-only messages (distressingly common these days), and there is no way to forward the HTML part instead of the text part inline (perhaps the HTML part has the real content). The first of these could be fixed by attaching all of the original non-inline attachments to the new message; this is what email clients like Outlook do when you forword a message. For the second and third parts, I have been experimenting with the following: --=-=-= Content-Type: text/html Content-Disposition: inline Content-Transfer-Encoding: quoted-printable
    =3D=3D=3D=3D=3D Forwarded message (HTML part only) follows =3D=3D=3D=3D=
=3D
    Date: Fri, 28 Dec 2012 19:44:57 -0000
    From: "Hilton Hotels & Resorts" 
    To: lillibridge@gmail.com
    Subject: Pick your paradise: choose from three unforgettable resort exp=
eriences
    Reply-To: "Hilton Hotels & Resorts" 
    
=20=20=20=20 Hilton Hotels & Resorts