emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: Eric Schulte <eric.schulte@gmx.com>
Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>,
	emacs-orgmode@gnu.org, ding <ding@gnus.org>
Subject: Re: org-mime-htmlize: visual representation (thunderbird)
Date: Wed, 11 Apr 2012 11:44:08 +0200	[thread overview]
Message-ID: <878vi2k3h3.fsf@gilgamesch.quim.ucm.es> (raw)
In-Reply-To: <87d37e6gmd.fsf@gmx.com> (Eric Schulte's message of "Wed, 11 Apr 2012 00:23:54 -0400")

>> On Wed, 11 Apr 2012 00:23:54 -0400, Eric Schulte <eric.schulte@gmx.com> wrote:

   > Uwe Brauer <oub@mat.ucm.es> 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)))))
`----

  reply	other threads:[~2012-04-11  9:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 11:01 Uwe Brauer
2012-03-31 17:13 ` Eric Schulte
2012-04-01 15:19   ` Uwe Brauer
2012-04-01 16:38     ` Eric Schulte
2012-04-10 13:00       ` Uwe Brauer
2012-04-11  4:23         ` Eric Schulte
2012-04-11  9:44           ` Uwe Brauer [this message]
2012-04-11 13:38             ` Eric Schulte
2012-04-12 11:59               ` Uwe Brauer
2012-04-12 12:21                 ` Eric Schulte

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.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878vi2k3h3.fsf@gilgamesch.quim.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=ding@gnus.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=eric.schulte@gmx.com \
    --cc=larsi@gnus.org \
    --subject='Re: org-mime-htmlize: visual representation (thunderbird)' \
    /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

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).