From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/81717 Path: news.gmane.org!not-for-mail From: Uwe Brauer Newsgroups: gmane.emacs.orgmode,gmane.emacs.gnus.general Subject: Re: org-mime-htmlize: visual representation (thunderbird) Date: Wed, 11 Apr 2012 11:44:08 +0200 Message-ID: <878vi2k3h3.fsf@gilgamesch.quim.ucm.es> References: <87ehsei9zj.fsf@gilgamesch.quim.ucm.es> <8762dky9pt.fsf@gmx.com> <4F787201.2020403@mat.ucm.es> <87wr5zjtje.fsf@gmx.com> <871unv7ncy.fsf@gilgamesch.quim.ucm.es> <87d37e6gmd.fsf@gmx.com> Reply-To: Uwe Brauer NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1334137481 10922 80.91.229.3 (11 Apr 2012 09:44:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Apr 2012 09:44:41 +0000 (UTC) Cc: Lars Magne Ingebrigtsen , emacs-orgmode@gnu.org, ding To: Eric Schulte Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Wed Apr 11 11:44:40 2012 Return-path: Envelope-to: geo-emacs-orgmode@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 1SHu6M-0002QS-NP for geo-emacs-orgmode@m.gmane.org; Wed, 11 Apr 2012 11:44:34 +0200 Original-Received: from localhost ([::1]:39397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHu6M-0001aj-4y for geo-emacs-orgmode@m.gmane.org; Wed, 11 Apr 2012 05:44:34 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHu68-0001ab-Tb for emacs-orgmode@gnu.org; Wed, 11 Apr 2012 05:44:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHu66-0000a9-Rx for emacs-orgmode@gnu.org; Wed, 11 Apr 2012 05:44:20 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:52032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHu66-0000Vi-F7 for emacs-orgmode@gnu.org; Wed, 11 Apr 2012 05:44:18 -0400 Original-Received: by werj55 with SMTP id j55so551038wer.0 for ; Wed, 11 Apr 2012 02:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:x-mailer:from:to:cc:subject:references:reply-to:x-hashcash :x-hashcash:date:in-reply-to:message-id:user-agent:mime-version :content-type; bh=9e3Pg94jnk11aqQtS0tbK07N7Z5BwiObe/1aYGsFgT8=; b=zfFO09FcPo4aHqC29cWw7GYks+f+KyDwcCuzY6FxX0OZaGksdgjtfn3wOonGwAucav IVWfVf8Eko6yRO0HamMYMCY/F4ki/iT9hJjHvBR8r3CJ2ia95/b8aus566F3Y2SQd7hx JIyOvv64R28nw68COgK7aAF9EqAJpEvskNBos5zqLtuBiZE4cH91i1q+ZrV3gsG+/tQI b/rWtggzE9iWZ9GrVCHRoar8naurP/q3Ld3eW+sikcMTFc4isyNvIhPbecxQvAqC1V7h cXwhGL3965b0gEW2p6WV3He9gWkjhI/UXTowQ2ws1nsWi05/2COiKdCDxZKgk0d8ZAyS muYg== Original-Received: by 10.216.45.146 with SMTP id p18mr8208317web.47.1334137456292; Wed, 11 Apr 2012 02:44:16 -0700 (PDT) Original-Received: from gilgamesch.quim.ucm.es (gilgamesch.quim.ucm.es. [147.96.12.99]) by mx.google.com with ESMTPS id fn2sm7849938wib.0.2012.04.11.02.44.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Apr 2012 02:44:15 -0700 (PDT) X-Mailer: 21.5 (beta31) "ginger" XEmacs Lucid (via feedmail 11-beta-1 I) X-Hashcash: 1:20:120411:emacs-orgmode@gnu.org::o/xIWUJe/MoJFXCe:00000000000000000000000000000000000000000r4n X-Hashcash: 1:20:120411:eric.schulte@gmx.com::/HYXF4XSclkUmUNn:00000000000000000000000000000000000000000AHmR In-Reply-To: <87d37e6gmd.fsf@gmx.com> (Eric Schulte's message of "Wed, 11 Apr 2012 00:23:54 -0400") User-Agent: Gnus/5.110018 (No Gnus v0.18) XEmacs/21.5-b31 (linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Original-Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.orgmode:54610 gmane.emacs.gnus.general:81717 Archived-At: >> On Wed, 11 Apr 2012 00:23:54 -0400, Eric Schulte wrote: > Uwe Brauer writes: >> >> Uwe >> > Hi Uwe, > Thanks for sending along this helpful review. I've just pushed two > changes to org-mime so that it now (1) wraps html and images in a > multipart/related mime structure and (2) marks images as "disposition > inline" so that they don't show up as attachments. Hi Eric, Thanks for your efforts. I have good and bad news. The bad news is your changes make things worse in Thunderbird, for reasons I don't understand the header of the resulting messages reads: Content-type: text/plain; charset=us-ascii which is wrong and now png are displayed! Which brings me to the good news. After I wrote to you I received a message from the TB developers which emphasised that, besides the information I have gave you, the main point is the header, which should be Content-type: multipart/related; boundary="=-=-=" and the thunderbird developers insist that this is the RFC 2387 standard. Gnus actually generate via the mml-generate-mime function the header Content-type: multipart/mixed; boundary="=-=-=" which is wrong. I brought up the issue in the gnus mailing list and the developers agreed that in the case of a html message with png the Content-type should follow the RFC standard. I checked this explicitly: your old code but with a different mml-generate-mime function generates a message which is correctly displayed in thunderbird and GMail and Ipod for that manner. BTW I don't know how this issue, of the Content-type in the header, is treated in VM or Wanderlust. Now the question is how to proceed: I had the idea of introducing a new variable mml-mime-use-related and wrap it into the mml-generate-mime code. Then org-mime-htmlize should set this variable to t, and later a different function should be added to the mail-send-hook setting the variable to nil again. Lars didn't like the idea and came up with a different implementation. However I don't see how to use it easily. So I include both solutions and let you decide which fits best for org-mime-htmlize. But as it is now you should undo your recent changes because even with the *new* mml-generate-mime function and your *new* code the resulting mail is not displayed correctly in TB. I have now added lars and the ding mailing list to the CC. Regards Uwe My solution: ,---- | (defvar mml-mime-use-related t | "*Variable to control whether to use `multipart/mixed' or `multipart/related'.") | | (defun mml-generate-mime () | "Generate a MIME message based on the current MML document." | (let ((cont (mml-parse)) | (mml-multipart-number mml-multipart-number)) | (if (not cont) | nil | (mm-with-multibyte-buffer | (if (and (consp (car cont)) | (= (length cont) 1)) | (mml-generate-mime-1 (car cont)) | (if mml-mime-use-related | (mml-generate-mime-1 (nconc (list 'multipart '(type . "related")) | cont)) | (mml-generate-mime-1 (nconc (list 'multipart '(type . "mixed")) | cont))) | (buffer-string)))))) `---- Lars solution ,---- | (defun mml-generate-mime (&optional multipart-type) | "Generate a MIME message based on the current MML document. | MULTIPART-TYPE defaults to \"mixed\", but can also | be \"related\" or \"alternate\"." | (let ((cont (mml-parse)) | (mml-multipart-number mml-multipart-number) | (options message-options)) | (if (not cont) | nil | (prog1 | (mm-with-multibyte-buffer | (setq message-options options) | (if (and (consp (car cont)) | (= (length cont) 1)) | (mml-generate-mime-1 (car cont)) | (mml-generate-mime-1 | (nconc (list 'multipart (cons 'type (or multipart-type "mixed"))) | cont))) | (setq options message-options) | (buffer-string)) | (setq message-options options))))) `----