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: [RESEND] PATCH for bug #9521, *not* bug #9766 Date: Fri, 28 Dec 2012 12:55:25 -0800 Message-ID: <87r4m999s2.fsf@foil.strangled.net> References: Reply-To: mdl@alum.mit.edu NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1356728176 17869 80.91.229.3 (28 Dec 2012 20:56:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Dec 2012 20:56:16 +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:56:31 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 1Togyk-0000ps-P7 for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Dec 2012 21:56:30 +0100 Original-Received: from localhost ([::1]:52998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TogyW-0003nk-Bd for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Dec 2012 15:56:16 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TogyS-0003ja-11 for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:56:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TogyP-0002UQ-1G for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:56:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53224) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TogyO-0002UM-Ob for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:56:08 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TogzG-0004BV-Fj for bug-gnu-emacs@gnu.org; Fri, 28 Dec 2012 15:57:03 -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:57:02 +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.135672819216032 (code B ref 9521); Fri, 28 Dec 2012 20:57:02 +0000 Original-Received: (at 9521) by debbugs.gnu.org; 28 Dec 2012 20:56:32 +0000 Original-Received: from localhost ([127.0.0.1]:35240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Togyl-0004AV-AE for submit@debbugs.gnu.org; Fri, 28 Dec 2012 15:56:31 -0500 Original-Received: from alum-mailsec-scanner-6.mit.edu ([18.7.68.18]:43488) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Togyg-0004AI-61; Fri, 28 Dec 2012 15:56:28 -0500 X-AuditID: 12074412-b7f216d0000008e3-42-50de07436eff 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 9E.18.02275.3470ED05; Fri, 28 Dec 2012 15:55:31 -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 qBSKtSFo006249 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 28 Dec 2012 15:55:30 -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+NgFvrNIsWRmVeSWpSXmKPExsUixO6iqOvMfi/AYOtnLouJe3ezWixp28du MfXjGTYHZo+/7z8weVyctI85gCmK2yYpsaQsODM9T98ugTvj8fEdTAWX1CqunzzN0sB4Sq6L kZNDQsBEYl/fRGYIW0ziwr31bF2MXBxCApcZJY72tjJBOFeZJN7OvMQCUsUmoCkx/dl3dhBb REBP4tOsB2C2sICZxI09rYwgNqdAscTLk5/YQGwhASmJpYtOgNWwCKhKvNn4FGgbBwevgL7E uk5dkDCvgKDEyZlPwMYzC2hJ3Pj3kmkCI+8sJKlZSFILGJlWMcol5pTm6uYmZuYUpybrFicn 5uWlFuma6eVmluilppRuYoQEldAOxvUn5Q4xCnAwKvHwnrp9N0CINbGsuDL3EKMkB5OSKO9x xnsBQnxJ+SmVGYnFGfFFpTmpxYcYJTiYlUR4pf4BlfOmJFZWpRblw6SkOViUxHl/Llb3ExJI TyxJzU5NLUgtgsnKcHAoSfDmsgANFSxKTU+tSMvMKUFIM3FwggznkhIpTs1LSS1KLC3JiAdF UnwxMJZAUjxAe6tB2nmLCxJzgaIQracY7Tm2vLjxlJHjxx8Q+WvlTSB58u2dp4xCLHn5ealS 4rxNIG0CIG0ZpXlwS2Fp5hWjODAMhHnrQap4gCkKbvYroLVMQGutee6ArC1JREhJNTBG8ExS TVpkFhmQOd82d/fiiVKR8c+PtMz7FM7x+fjvrMuc35/ZROi+/7h894KEGZO2m84UnP7X/H+a 1iJJphcBinJqRvUMp8U33Jlm/vynnUbFHiXlZIUvN+dVNZh5mCpxcuR/9/5rnWW9 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:69127 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 (had to add " " after <'s to make < #parts escaped): < #part type=text/html disposition=inline raw=t>
    ===== Forwarded message (HTML part only) follows =====
    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 experiences
    Reply-To: "Hilton Hotels & Resorts" 
    
Hilton Hotels & Resorts