Before I get too deep into this, I want to say that I absolutely think
we need to plan out where we're going with this, since bug 602718 was
meant to fix fallout from bug 351224[2], and we've got bug 674473[3] to
fix fallout from 602718. We really need to figure out what the most
appropriate behavior is before we continue further.
In the short term, we may want to consider backing out bug 351224 and
friends, since detaching multipart/related parts is much less important
than being able to see parts from (admittedly malformed) messages. While
a part of me wants to say that Thunderbird is behaving correctly here,
and that we shouldn't have to deal with malformed messages, the reality
is that they exist and there's not a whole lot that users can do about
it. We should try to follow the old adage: "be lenient in what you
accept and strict in what you produce." I'm not dead-set on this course,
but I do think it's worth considering.
In the medium term, we should strive to be fully standards-compliant
with messages by default, with options to tweak behavior according to
user preferences or to deal with malformed messages. Specifically, this
means that by default we should:
* Show "Content-Disposition: inline" parts inline only
* Show "Content-Disposition: attachment" parts in the attachment pane
only
* Ignore attachment-like parts in other containers, e.g.
* multipart/alternative parts we don't handle (in a properly formed
message, these parts should only have presentational differences)
* multipart/related parts that aren't referenced in the message
For the last case, we could probably be smart enough to throw up a
message along the lines of "This message is malformed and some parts of
it may be hidden. Please contact the sender to let them know. In the
meantime, would you like to show hidden attachments?" Saying yes would
flip a pref that treats every conceivable part as an attachment, i.e.
Content-Disposition: inline parts, all multipart/related parts,
multipart/alternative parts we don't render (or maybe just those we
*can't* render).
We should also have an option for how to handle Content-Disposition. We
already have this, but it's currently a boolean, and I think it should
be a 3-state: 1) use defaults from the message, 2) show all inline, 3)
show none inline. In the case of (3), we may or may not want to list
Content-Disposition: attachment parts in the attachment list. I think we
probably should, since that makes it easier to save those parts.
We could also add the ability to open/detach/delete parts that are
displayed inline. This wouldn't help with dealing with large batches of
inline parts, but it would let people do everything with inline parts
that they can do with attachment parts.
Farther in the future, we should look into supporting other parts of the
RFCs, e.g. message/partial. We should also ensure that the messages
produced by Mozilla are well-formed, including letting people change the
various properties of parts, e.g. setting Content-Disposition. This
would help us to be good neighbors and to let users at least attempt to
indicate how they want their message to be rendered.
I'm sure there are other libmime gurus who have some input on this, and
who probably have a more thorough understanding of the relevant RFCs, so
I'm interested to hear what others think of this plan.
- Jim
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=602718
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=351224
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=674473
I completely agree.
> In the short term, we may want to consider backing out bug 351224 and
> friends, since detaching multipart/related parts is much less important
> than being able to see parts from (admittedly malformed) messages. While
> a part of me wants to say that Thunderbird is behaving correctly here,
> and that we shouldn't have to deal with malformed messages, the reality
> is that they exist and there's not a whole lot that users can do about
> it. We should try to follow the old adage: "be lenient in what you
> accept and strict in what you produce." I'm not dead-set on this course,
> but I do think it's worth considering.
I think, just as Firefox has to deal with malformed pages, we need to
deal with malformed email messages as best we can. I also don't think
we have the market penetration to force Outlook/Exchange to conform to
the standards, so attempting to pressure them by not showing their
malformed messages would only hurt us.
> Specifically, this means that by default we should:
>
> * Show "Content-Disposition: inline" parts inline only
> * Show "Content-Disposition: attachment" parts in the attachment pane
> only
I'm with you so far.
> * Ignore attachment-like parts in other containers, e.g.
> * multipart/alternative parts we don't handle (in a properly formed
> message, these parts should only have presentational differences)
> * multipart/related parts that aren't referenced in the message
I think this is a bad idea, for the reasons given above. Even the
preference/popup wouldn't be enough to mitigate it, I'm afraid.
> I'm sure there are other libmime gurus who have some input on this, and
> who probably have a more thorough understanding of the relevant RFCs, so
> I'm interested to hear what others think of this plan.
I'm not exactly a libmime guru, but those are my thoughts anyways. ;)
Later,
Blake.
Wrong bug reference here.
This should be:
https://bugzilla.mozilla.org/show_bug.cgi?id=685072
We've already been discussing this on mdat:
<http://groups.google.com/group/mozilla.dev.apps.thunderbird/browse_thread/thread/cf8c349907d129d1>.
Last I'd heard, Joshua Cranmer had a prototype parser written in
Javascript working. I'm not sure if third-party libs would be
appropriate here, but you're welcome to discuss this in that thread, or
on IRC.
As someone who works on libmime occasionally, I'm sympathetic to
people's desire to destroy it, but we shouldn't let libmime deteriorate
further while we wait for a different MIME parser.
>> In the short term, we may want to consider backing out bug 351224 and
>> friends, since detaching multipart/related parts is much less important
>> than being able to see parts from (admittedly malformed) messages.
>
> If you do this, you're just choosing which constituency to
> upset.
>
> Yes, there are a lot of people upset about not being able to
> see some attachments.
>
> However, if you look at the bug which prompted me to dive into
> this mess in the first place, i.e., the bug about being unable
> to delete attachments from certain multipart/related messages,
> you will see that there were also a whole lot of people upset
> about that bug as well.
>
> Your claim that one is "much less important than" the other
> is not at all obvious to me.
If we look at the totally-unscientific measure of which bugs have more
activity, then seeing the currently-hidden attachments is clearly a more
common use case: in 4 years, 3 people commented wanting the ability to
detach multipart/related subparts. In contrast, bug 602718 has 5 dupes
(they should probably be duped to bug 674473, but oh well) and at least
10 people posting about it (I lost count at this point) in various bugs
in the span of about a year.
> Furthermore, with the Show All Body Parts functionality, we
> have a solution to the hidden attachments problem. Not an
> ideal solution, mind you, but a solution. Whereas if you back
> out the changes which now allow attachments in
> multipart/related messages to be removed, then we will *not*
> have a solution to that problem.
This functionality isn't available in Thunderbird 7, so there's no
solution to this problem in that version. At the very least, this should
be backed out of 7. I'm ok with leaving the code in 9, and maybe in 8 if
we can get fixes in time, but not for 7.
> In my opinion, I don't think we should back out the changes
> (and yes, I obviously am biased, since I wrote them). Rather,
> I think we should make the View | Message Body As | All Body
> Parts command visible to everyone rather than only visible if
> you install an add-on to enable a hidden preference. I don't
> agree with the UI decision to hide this functionality.
If the option didn't negatively affect rendering of the body, I think
this would be ok. However, since it does, it's not something most people
would be able to enable for all messages*. I think that's what we want,
since people who need this option will probably need it for many
messages (e.g. messages from the same sender).
>> In the medium term, we should strive to be fully standards-compliant
>> with messages by default, with options to tweak behavior according to
>> user preferences or to deal with malformed messages.
>
> I agree with others who have expressed disagreement with this
> approach. Thunderbird should simply do the best it can to
> automatically and without complaint display as much of the
> message as it can in the way the user is most likely to
> expect. Whether or not the message is standards-compliant is
> irrelevant to most users. No, I don't like that the clients
> generating malformed MIME have to be accommodated, but that's
> life.
This is fine, provided people give compelling reasons why some malformed
messages should be handled in a certain way. We obviously need to do
*something* for malformed multipart/related objects, but for other types
of hidden content, it's less clear (e.g. multipart/alternative objects
with subparts we can't handle).
As I mentioned in an earlier reply, I'm not dead-set on being myopically
standards-compliant, but following the RFCs is the simplest course of
action, so I think it makes sense as a starting point. We can certainly
adjust the behavior to be more lenient, provided we aren't hurting
well-formed messages.
Basically, I'm ok with treating unreferenced multipart/related subparts
as attachments, but I want to make sure everyone agrees on what exactly
the behavior should be.
- Jim
* See WADA's comment here for more details:
<https://bugzilla.mozilla.org/show_bug.cgi?id=674473#c19>
I'm not sure what bug you're looking at. I see 15 users on
the CC list and 7 votes for bug 351224 about deleting
multipart/related attachments. Bug 417646, which was
eventually marked a dup of 351224, has 17 users on the CC
list and 8 votes (no, I didn't look at how much overlap there
was).
>This functionality isn't available in Thunderbird 7, so there's no
>solution to this problem in that version. At the very least, this should
>be backed out of 7. I'm ok with leaving the code in 9, and maybe in 8 if
>we can get fixes in time, but not for 7.
We could just as easily backport the All Body Parts
functionality to Thunderbird 7 as back out the fix for bug
351224. In fact, backporting the All Body Parts changes would
probably be easier.
>If the option didn't negatively affect rendering of the body, I think
>this would be ok. However, since it does, it's not something most people
>would be able to enable for all messages*. I think that's what we want,
>since people who need this option will probably need it for many
>messages (e.g. messages from the same sender).
I don't agree.
I think while it's not ideal, it's perfectly reasonable for
users to switch to View | Message Body As | All Body Parts
temporarily when they notice that there's an attachment
they're supposed to be seeing but don't.
Certainly, I think asking users to do this temporarily until
we improve libmime is better than going back to the days when
it was impossible to detach or delete attachments in certain
MIME messages.