Incorrect processing of multipart/related
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
VM |
Fix Committed
|
Medium
|
Unassigned |
Bug Description
Certain emails with [cid...] in the text part, which report the existence of inline images, do not get decoded with the current stable version of vm (8.20a on emacs 23.3). I can forward an example of this type of email, which seems to have appeared recently (new Microsoft trick?). By the way, mutt seems to be able to handle messages of this type.
Related branches
Uday Reddy (reddyuday) wrote : Re: [Bug 881411] [NEW] Mime attachment not processed correctly. | #1 |
David Raymond (raymond-kestrel) wrote : Re: Mime attachment not processed correctly. | #2 |
- test email in which mime is not correctly decoded Edit (1.4 MiB, text/plain)
Here is an example email which doesn't get decoded correctly. There are two png files which get lost. (The html part does get decoded.)
No need to mark this private.
John Hein (xpqheqdvq4) wrote : | #3 |
I've seen this before, too. Editing the email and changing multipart/related to multipart/mixed (in the main Content-type header) lets me at least see the image buttons so I can use '$ e' to see the images with an external viewer.
David Raymond (raymond-kestrel) wrote : | #4 |
Regarding John Hein's comment, I tried this modification as well and vm can decipher the
modified email.
Uday Reddy (reddyuday) wrote : | #5 |
This message came up Content-Type "multipart/
|- multipart/related
|- multipart/
|- text/plain
|- text/html
|- image/png
|- image/png
whereas the correct structure would have been:
|- multipart/
|- text/plain
|- multipart/related
|- text/html
|- image/png
|- image/png
Assuming that you are using emacs-w3m to decode html, VM would pass the multipart/related content to emacs-w3m, which handles the images fine. However, since the message came with a multipart/
I notice that an old RFC, 1872, asked for this kind of special treatment of multipart/
I will think about how best to work around the problem.
John Hein (xpqheqdvq4) wrote : | #6 |
I seem to recall discussion in the past about making vm-decode-
John Hein (xpqheqdvq4) wrote : | #7 |
I should have mentioned that workaround (in my comment #6) doesn't address a solution for the "broken" mime, just a workaround to allow a user to get at the otherwise invisible mime without too much trouble (like having to edit the message or go to raw mode, save the message and decode a mime part manually).
Tim Cross (tcross) wrote : Re: [Bug 881411] Re: Mime attachment not processed correctly. | #8 |
On Sat, Nov 5, 2011 at 3:29 AM, John Hein <email address hidden> wrote:
> I seem to recall discussion in the past about making vm-decode-mime-
> message do a more complete job at displaying all the various mime parts
> as buttons. Maybe another state in addition to the current 3 states:
> decoded, buttons, raw. Perhaps change 'buttons' to two states: one that
> display buttons normally based on configured visibility and another that
> displays all buttons regardless of visibility rules (maybe "visible" and
> "invisible" mime parts?).
>
> --
> You received this bug notification because you are subscribed to VM.
> https:/
>
> Title:
> Mime attachment not processed correctly.
>
> Status in VM (View Mail) for Emacs:
> New
>
> Bug description:
> Certain emails with [cid...] in the text part, which report the
> existence of inline images, do not get decoded with the current
> stable version of vm (8.20a on emacs 23.3). I can forward an example
> of this type of email, which seems to have appeared recently (new
> Microsoft trick?). By the way, mutt seems to be able to handle
> messages of this type.
>
> To manage notifications about this bug go to:
> https:/
>
IIRC that was something Robert did when I was receiving messages from
a client using Apple Mail where the attachments were embedded inside
poorly structured MIME. The workaround Robert provided was to enable
all MIME objects to be displayed so that you could select individual
'bits'. As you point out, this ws a workaround. I'm not sure what
happened to that functionality possibly the issue with Apple Mail
attachments was fixed and so the functionality was removed?
Tim
--
Tim Cross
Uday Reddy (reddyuday) wrote : Re: Mime attachment not processed correctly. | #9 |
Hi Tim, the Apple Mail problem is quite different. (It has to do with multipart/
Uday Reddy (reddyuday) wrote : | #10 |
To be perfectly clear, the standard requires any multipart/related combinations that VM can't figure out to be treated as if they were multipart/mixed. VM isn't doing so at present, and it is "buggy" to that extent.
Changed in vm: | |
status: | New → Triaged |
milestone: | none → 8.2.1 |
importance: | Undecided → Low |
Tim Cross (tcross) wrote : Re: [Bug 881411] Re: Mime attachment not processed correctly. | #11 |
On Sun, Nov 6, 2011 at 11:39 AM, Uday Reddy <email address hidden> wrote:
> Hi Tim, the Apple Mail problem is quite different. (It has to do with
> multipart/
>
> --
> You received this bug notification because you are subscribed to VM.
> https:/
>
> Title:
> Mime attachment not processed correctly.
>
> Status in VM (View Mail) for Emacs:
> Triaged
>
> Bug description:
> Certain emails with [cid...] in the text part, which report the
> existence of inline images, do not get decoded with the current
> stable version of vm (8.20a on emacs 23.3). I can forward an example
> of this type of email, which seems to have appeared recently (new
> Microsoft trick?). By the way, mutt seems to be able to handle
> messages of this type.
>
> To manage notifications about this bug go to:
> https:/
>
Sorry, I should have been clearer. I was only referring to the feature
which allowed all mime parts to be displayed as buttons that John
referred to. When the issue with Apple Mail attachments first came up,
that was the workaround which was provided so taht you could at least
get to the attachment. I wasn't meaning to imply that it was the same
problem, only background on what John was saying. From memory, I had
to apply a patch that (Rob?) provided in order to have this
functionality. Looking through my archives, I can find references to
this issue, but not he patch. I wouldn't expect it to be directly
applicable, but was hoping ti would provide a starting point for a
temporary workaround.
Tim
Tim
--
Tim Cross
summary: |
- Mime attachment not processed correctly. + Incorrect processing of multipart/related |
Changed in vm: | |
importance: | Low → Medium |
Uday Reddy (reddyuday) wrote : | #12 |
But, surprisingly, some multipart/related messages seem to work. See Bryoney Johnson, 2011-01-31, in test-mime.
tags: | added: 7.19 mime |
Mark Diekhans (markd-kermodei) wrote : | #13 |
It would be very useful to have a hierarchal mime part listing, very similar to what Uday showed in #5.
Get just this kind of tree with buttons to display mime parts at any level. I am often mystified by the exact structure of the mail and have trouble finding exactly with part I need to see.
Uday Reddy (reddyuday) wrote : [Bug 881411] Re: Incorrect processing of multipart/related | #14 |
Mark Diekhans writes:
> It would be very useful to have a hierarchal mime part listing, very
> similar to what Uday showed in #5.
Try vm-mime-
drawing :-) but it works. I notice that it is not described in the manual.
Another to-do item here.
Cheers,
Uday
David Raymond (raymond-kestrel) wrote : | #15 |
Uday,
So, any ideas on how to fix the problem? If the hierarchal listing
could be turned into a list in which one could select attachments to
display or save, that would work for me. This is sort of how mutt
does it.
Best regards,
Dave
Uday Reddy writes:
> Mark Diekhans writes:
>
> > It would be very useful to have a hierarchal mime part listing, very
> > similar to what Uday showed in #5.
>
> Try vm-mime-
> drawing :-) but it works. I notice that it is not described in the manual.
> Another to-do item here.
>
> Cheers,
> Uday
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https:/
>
> Title:
> Incorrect processing of multipart/related
>
> Status in VM (View Mail) for Emacs:
> Triaged
>
> Bug description:
> Certain emails with [cid...] in the text part, which report the
> existence of inline images, do not get decoded with the current
> stable version of vm (8.20a on emacs 23.3). I can forward an example
> of this type of email, which seems to have appeared recently (new
> Microsoft trick?). By the way, mutt seems to be able to handle
> messages of this type.
>
> To manage notifications about this bug go to:
> https:/
--
David J. Raymond
Prof. of Physics
New Mexico Tech
http://
Uday Reddy (reddyuday) wrote : | #16 |
I can give you a flag that treats `multipart/related' as if it were `multipart/mixed'. Until then, you have to edit the messages manually to do that conversion (as John Hein recommended).
Cheers,
Uday
David Raymond (raymond-kestrel) wrote : | #17 |
That would work. -- Dave
Uday Reddy writes:
> I can give you a flag that treats `multipart/related' as if it were
> `multipart/mixed'. Until then, you have to edit the messages manually
> to do that conversion (as John Hein recommended).
>
> Cheers,
> Uday
--
David J. Raymond
Prof. of Physics
New Mexico Tech
http://
Uday Reddy (reddyuday) wrote : | #18 |
Initial fix committed in rev. 1361.
Changed in vm: | |
status: | Triaged → In Progress |
no longer affects: | vm/8.2.x |
Changed in vm: | |
milestone: | 8.2.90a → 8.2.0b1 |
Uday Reddy (reddyuday) wrote : | #19 |
Dear David and John, Rechecking this bug report, I find that VM 8.2.0a has been working fine for multipart/related content as long as you use emacs-w3m as your html viewer.
Can you clarify what settings you used for html viewing, when you reported the original problem?
Cheers,
Uday
David Raymond (raymond-kestrel) wrote : | #20 |
Dear Uday,
I am using chromium for html stuff. The pertinent part of my .emacs
file is listed below.
When I try to load emacs-w3m, emacs23 says that w3m isn't supported.
Best,
Dave
-------
;;; Load VM
(require 'vm-autoloads)
;;; the vm-reply library doesn't get autoloaded (bug in 8.2.0b)
(load "/usr/share/
;;; VM configuration
(setq vm-mail-header-from "David Raymond <email address hidden>")
(setq vm-use-toolbar nil)
(setq vm-fill-
(setq vm-move-
(setq vm-mutable-frames nil)
(setq vm-preview-lines nil)
(setq vm-auto-
(setq vm-folder-directory "~/Mail/")
(setq vm-confirm-
(setq vm-delete-
(setq vm-mime-
(setq vm-mime-
(setq vm-reply-
(add-to-list 'vm-mime-
(add-to-list 'vm-mime-
(add-to-list 'vm-mime-
(setq vm-mime-
(setq vm-imagemagick-
(setq vm-mime-
(setq vm-mime-
(setq vm-auto-
(setq vm-auto-
(setq vm-mime-
'(
;("text/html" "chromium")
("image/eps" "gv")
("image" "ristretto")
("applicatio
("applicatio
("applicatio
("applicatio
))
(define-key menu-bar-tools-menu [rmail] '("Read Mail" . vm))
(define-key-after menu-bar-tools-menu [smail] '("Send Mail" . vm-mail) 'rmail)
;;; Sendmail configuration
(setq mail-user-agent 'sendmail-
(setq mail-from-style 'angles)
(setq user-full-name "David Raymond")
(setq user-mail-address "<email address hidden>")
(setq mail-default-
;;; Mail archiving
(setq mail-archive-
;;; BBDB setup
(require 'bbdb)
(bbdb-initialize 'sendmail 'vm)
(bbdb-insinuate-vm)
(add-hook 'mail-setup-hook 'bbdb-insinuate
(setq bbdb-quiet-
(setq bbdb-use-pop-up nil)
(setq bbdb/mail-
;;; Set external browser
(setq browse-
browse-
-------
Uday Reddy writes:
> Dear David and John, Rechecking this bug report, I find that VM 8.2.0a
> has been working fine for multipart/related content as long as you use
> emacs-w3m as your html viewer.
>
> Can you clarify what settings you used for html viewing, when you
> reported the original problem?
>
> Cheers,
> Uday
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https:/
>
> Title:
> Incorrect processing of multipart/related
>
> Status in VM (View Mail) for Emacs:
> In Progress
>
> Bug description:
> Certain emails with [cid...] in the text part,...
Uday Reddy (reddyuday) wrote : | #21 |
Ok, that confirms that 8.2.0a was working ok.
If you can get emacs-w3m to work, you will see much better performance for
html. multipart/related content is not expected to work with external
viewers.
Cheers,
Uday
visibility: | public → private |
Changed in vm: | |
status: | In Progress → Fix Committed |
John Hein (xpqheqdvq4) wrote : | #22 |
I have a message (from outlook/exchange) that has a structure like so (reported by vm-mime-
=================
Some subject
("multipart/
("multipart/
("text/plain" "charset=us-ascii")
("text/html" "charset=us-ascii")
("image/png" "name=image001.
=================
With either...
vm-mime-
or
vm-mime-
and...
(a) vm-mime-
I have to edit the multipart/related to be multipart/mixed in order to see the image attachment (invoking vm-mime-
In both emacs with X and emacs -nw, if I leave the multipart/related (instead of multipart/mixed) no image attachment button is visible. It is this case, where it would be nice to have the extra state in vm-decode-
(b) vm-mime-
This is the same as (a) except that in the emacs/X case, the image is displayed inline (if you have inline images enabled). This is not the same as having the image mime button available.
Here's a table that explains it better perhaps (probably best viewed on the web rendering of this bug, but we'll see what it looks like after I post it):
vm-mime-
-------
("text/html") related X no no
nil related X yes no
("text/html") mixed X no yes
nil mixed X yes yes
("text/html") related nw no no
nil ...
John Hein (xpqheqdvq4) wrote : | #23 |
In the previous post, "inline images enabled" means 'vm-w3m-
Uday Reddy (reddyuday) wrote : | #24 |
John Hein writes:
> I have to edit the multipart/related to be multipart/mixed in order to
> see the image attachment (invoking vm-mime-
> displays the text and the image buttons).
What you have to do to deal with buggy messages is a separate issue. I have
now added a variable using which you can get multipart/related treated as if
it is multipart/mixed. So, you are taken care of.
The question I am concerned about here is what the "bug" is that this bug
report is reporting.
multipart/related is meant for images that need to be embedded in message
display. Obviously this is only possible if you use an internal viewer for
the message display. If you use an external viewer, then the images cannot
be embedded. I don't think any mail client is able to handle that.
multipart/related also says that the first component of the multipart must
specify the content-type of the message, so that the mail client can decide
how to deal with it. If it knows that it can embed the images then it will
do so. If it know that it can't, then it will treat it as if it is
multipart/mixed.
However, Microsoft or whoever are sending messages where the first part is
not a content-type, but a multipart/
and make a decision. So, it does the next best thing, viz., to assume that
the first part can deal with the embedded images. If you use an internal
viewer (which is Emacs-W3M for html), then it can embed images and it is
doing so.
When I wrote response #5, I seem to have thought that Emacs-W3M wasn't doing
it. But, on double checking, I find that it is doing it.
So, what is the "bug"?
Cheers,
Uday
Uday Reddy (reddyuday) wrote : | #25 |
John Hein writes:
> So as you can see, there still exists a case where you cannot get to the
> image without editing the 'related' to be 'mixed'.
Sorry, I couldn't figure out the case from the table. Can you be explicit?
Cheers,
Uday
John Hein (xpqheqdvq4) wrote : | #26 |
John Hein (xpqheqdvq4) wrote : | #27 |
Re: comment #25... the case is that there is (currently, in 8.2.0b-ish vm versions) no vm-ish way to get to the image without having to jump through some hoop of some sort. Namely...
_If_ you're running emacs/X, and if you have emacs-w3m, and if you have inline images enabled, you can _see_ the image. Also vm-mime-
If you manually edit the message to change related to mixed, you can get to the mime button and do the normal various vm mime operations on it.
You could also vm-mime-
As you say, the ability to "treat multipart/related as multipart/mixed" will help here.
Uday Reddy wrote in comment #24:
> multipart/related is meant for images that need to be embedded in message
> display. Obviously this is only possible if you use an internal viewer for
> the message display. If you use an external viewer, then the images cannot
> be embedded. I don't think any mail client is able to handle that.
Well, in theory, a mail reader could replace the CID tag with an image
ref, generate new html and save it to a temp location along with the
image, then spawn the external viewer pointing to the slightly
modified html.
But, I don't think anyone is asking for that here.
> multipart/related also says that the first component of the multipart must
> specify the content-type of the message, so that the mail client can decide
> how to deal with it. If it knows that it can embed the images then it will
> do so. If it know that it can't, then it will treat it as if it is
> multipart/mixed.
>
> However, Microsoft or whoever are sending messages where the first part is
> not a content-type, but a multipart/
> and make a decision. So, it does the next best thing, viz., to assume that
> the first part can deal with the embedded images. If you use an internal
> viewer (which is Emacs-W3M for html), then it can embed images and it is
> doing so.
>
> When I wrote response #5, I seem to have thought that Emacs-W3M
> wasn't doing it. But, on double checking, I find that it is doing
> it.
Yes, emacs-w3m + image inlining works for me on these kinds of messages, too (as you can see from the stupendous table I attached in comment #26).
> So, what is the "bug"?
Good question. I don't know if the OP, Dave, wanted the images
decoded and displayed inline or just a way to get at the image.
I just wanted the latter, and in that sense I perhaps hijacked
this bug, however at the time, the edit-to-mixed hack workaround
(comment #3) seemed to appease Dave (comment #4), so I suspect
the latter is all he needs, too - but I could be wrong.
Uday Reddy (reddyuday) wrote : | #28 |
John Hein writes:
> _If_ you're running emacs/X, and if you have emacs-w3m, and if you have
> inline images enabled, you can _see_ the image. Also vm-mime-save-all-
> attachments will allow you to save it. But you can't get to just one
> individual mime attachment (like if you just want to launch an external
> image viewer without having to save all the attachments, go to the shell
> or a file manager and manually start the image viewer in whatever your
> favorite way is).
I think what is happening is that people are doing drag-and-drop into the
html editor instead of "attaching" graphics images. The html editors assume
that they want to place the images in the middle of the text rather than
attaching them. That is why we are seeing increasing use of
multipart/related.
Treating multipart/related as multipart/mixed will solve these problems for
you.
But, that is not what multipart/related was designed for. Quoting RFC 2387:
The Multipart/Related media type is intended for compound objects
consisting of several inter-related body parts. For a
Multipart/
individually displaying the constituent body parts.
For genuine multipart/related content, I have now found a nice generic
solution. Commiting it soon.
Cheers,
Uday
David Raymond (raymond-kestrel) wrote : | #29 |
Dear Uday and John,
Wow, this is getting complicated! I can see Uday's point that
this may not be a bug as long as use of vm requires an internal
browser such as emacs-w3m. I tried installing and using emacs-w3m
(the cvc version for emacs23!) and it caused me nothing but trouble.
I had to reinstall emacs before I could use chromium as the
external browser again!
I would be happy with an option to convert "related" to "mixed";
something like
(setq vm-convert-
nil.
If it is any consolation, mutt presents "related" images separate
from the html as well.
Best regards,
Dave
Uday Reddy writes:
> John Hein writes:
> ...
> So, what is the "bug"?
>
> Cheers,
> Uday
Uday Reddy (reddyuday) wrote : | #30 |
Fix committed in rev. 1375 and 1377.
We keep track of whether the multipart/related processing was successful and, if not, fall back to multipart/mixed method.
David Raymond (raymond-kestrel) wrote : | #31 |
Hello Uday,
I guess this fix has not made it into a released version yet. Is there
a way to download a current snapshot? Or, do you not recommend this?
Thanks,
Dave
Uday Reddy writes:
> Fix committed in rev. 1375 and 1377.
>
> We keep track of whether the multipart/related processing was successful
> and, if not, fall back to multipart/mixed method.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https:/
>
> Title:
> Incorrect processing of multipart/related
>
> Status in VM (View Mail) for Emacs:
> Fix Committed
>
> Bug description:
> Certain emails with [cid...] in the text part, which report the
> existence of inline images, do not get decoded with the current
> stable version of vm (8.20a on emacs 23.3). I can forward an example
> of this type of email, which seems to have appeared recently (new
> Microsoft trick?). By the way, mutt seems to be able to handle
> messages of this type.
>
> To manage notifications about this bug go to:
> https:/
--
David J. Raymond
Prof. of Physics
New Mexico Tech
http://
Uday Reddy (reddyuday) wrote : | #32 |
Hi David, the README file in the vm directory explains how to download the development version of VM via Bazaar.
David Raymond (raymond-kestrel) wrote : | #33 |
Thanks Uday, I got the latest tarball and installed it. -- Dave
Uday Reddy writes:
> Hi David, the README file in the vm directory explains how to download
> the development version of VM via Bazaar.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https:/
>
> Title:
> Incorrect processing of multipart/related
>
> Status in VM (View Mail) for Emacs:
> Fix Committed
>
> Bug description:
> Certain emails with [cid...] in the text part, which report the
> existence of inline images, do not get decoded with the current
> stable version of vm (8.20a on emacs 23.3). I can forward an example
> of this type of email, which seems to have appeared recently (new
> Microsoft trick?). By the way, mutt seems to be able to handle
> messages of this type.
>
> To manage notifications about this bug go to:
> https:/
--
David J. Raymond
Prof. of Physics
New Mexico Tech
http://
information type: | Private → Public |
Changed in vm: | |
milestone: | 8.2.1a → 8.2.0 |
Changed in vm: | |
milestone: | 8.2.1a → 8.2.90a |
Yes, please. Please do upload a sample message that shows the problem. You
can mark the bug report as private so that it won't be visible to the
public.
Cheers,
Uday