After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 470291 - [prefer-plain] When using text-only display mode, HTML part is shown as attachment
[prefer-plain] When using text-only display mode, HTML part is shown as attac...
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Plugins
2.10.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-plugin-maintainers
Evolution QA team
: 546664 570931 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-08-25 21:01 UTC by Nicolas Trangez
Modified: 2009-10-30 13:03 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
proposed evo patch (4.13 KB, patch)
2009-08-06 11:23 UTC, Milan Crha
committed Details | Review

Description Nicolas Trangez 2007-08-25 21:01:12 UTC
I got plaintext-only mode configured in Evolution. Whenever I get an email which contains both a text and a HTML message part, the text part is displayed like it should, but also one attachment of type "unknown attachment" is displayed in the same way as any "normal" attachment. This is pretty confusing as it is no attachment at all, and the attachment display bar eats up some space in the UI.
Comment 1 Akhil Laddha 2008-06-24 04:50:35 UTC
can you please attach a sample mail after removing confidential information and if possible try in current stable 2.22.2, thanks.
Comment 2 D Haley 2009-02-19 07:06:15 UTC
I can confirm this bug. HTML emails sent appear only as an attachment, with no message body.

Expected result:
HTML should be converted to text insofar as possible (perhaps like html2text).

$ evolution --version
GNOME evolution 2.22.3.1

Installed via debian "lenny". The message source is provided below

X-MimeOLE: Produced By Microsoft Exchange V6.5
Received:  from IP([IP]) by MAILSERVER
        ([IP1]) via Exchange Front-End Server www.SERVER.TLD
        ([IP2]) with Microsoft Exchange Server HTTP-DAV ; Thu, 12 Feb
        2009 01:41:50 +0000
MIME-Version: 1.0
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
User-Agent: Microsoft-Entourage/11.3.6.070618
Content-class: urn:content-classes:message
Subject: SUBJECT
Date: Thu, 12 Feb 2009 TIMEZONE
Message-ID: <USERID>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: TOPIC
thread-index: DATA
From: FROMFIELD
To: ADDRESS
X-Evolution-Source: exchange://MYACCOUNT/

<HTML>
<HEAD>
<TITLE>EMAILTITLE</TITLE>
</HEAD>
<BODY>
<FONT FACE=3D"Verdana, Helvetica, Arial"><SPAN =
STYLE=3D'font-size:12.0px'>Dear colleagues<BR>
<BR>
This is a memo<BR>
<BR>
Many thanks<BR>
<BR>
Person<BR>
-- <BR>
SNIP SIGNATURE
</SPAN></FONT>
</BODY>
</HTML>

Comment 3 Paul Bolle 2009-03-17 23:47:00 UTC
(In reply to comment #2)
> I can confirm this bug. HTML emails sent appear only as an attachment, with no
> message body.
> 
> Expected result:
> HTML should be converted to text insofar as possible (perhaps like html2text).

This is a (slightly) different issue. Comment #0 concerns the fact that the prefer-plain-text plugin will (in either prefer plain of plain only mode) transform the text/html part into an attachment. Reporter suggests to not do that (and entirely hide the text/html part).

Your example mail is only text/html (i.e. it has no text/plain part). This means that in plain-only mode there's nothing left to show but an attachment.html (of type unknown attachment). The prefer-plain plugin is doing here just what you asked it.

For converting html to text (in cases like your mail) you might consider opening a separate bug (but please check whether something like that hasn't been filed yet).
Comment 4 D Haley 2009-03-18 04:09:01 UTC
Done as Bug 575788
Comment 5 Milan Crha 2009-08-05 20:05:23 UTC
Nicolas, it had been done intentionally, to allow user show also the html part, in case it contains something important. I wonder whether we really want to hide it completely. Any idea, Matt?
Comment 6 Matthew Barnes 2009-08-05 20:43:28 UTC
First question is why Evolution does not recognize the text/html part.  I ought to be able to view it inline, like any other text attachment.

Once that's fixed, I think a reasonable behavior is to show the text/html part as an attachment (collapsed, but viewable) if "Prefer PLAIN" is selected but hide it if "Only ever show PLAIN" is selected.

I use "Prefer PLAIN", but sometimes I do want to see the HTML version of certain emails.  This approach would let me do so without having to go into Preferences and flip the master switch for all emails.
Comment 7 Milan Crha 2009-08-06 09:03:12 UTC
With "prefer plain" it is working as you said. But the "Only ever show PLAIN" isn't. Thus I will fix it.
Comment 8 Milan Crha 2009-08-06 09:58:45 UTC
Hrm, so the prefer-plain plugin influences two parts:
a) multipart/alternative - based on its options it shows/hides html part from
   there, which is, in my opinion, the right thing
b) text/html - it blocks these parts with "Only ever show PLAIN", no matter
   if it's part of the a) or a single part of the email, even requested by user
   to show this part. Note that hiding the HTML part completely makes a message
   from comment #2 empty, which is incorrect.

Thinking of it, I believe the correct behaviour of prefer-plain would be:
a) Never hide HTML parts for a user, the most collapse them as attachments
b) When user requests to expand such HTML part then show it

With the above, even with "Only ever show PLAIN" will offer a possibility to show the part, which would be otherwise hidden.
Comment 9 Milan Crha 2009-08-06 11:23:02 UTC
Created attachment 140011 [details] [review]
proposed evo patch

for evolution;

This makes it for me. Please test someone. If accepted, the bug 575788 can be marked as a duplicate. (It's easier to solve this in one bug than in two.)
Comment 10 Milan Crha 2009-08-06 12:17:17 UTC
*** Bug 546664 has been marked as a duplicate of this bug. ***
Comment 11 D Haley 2009-08-06 12:57:57 UTC
>With the above, even with "Only ever show PLAIN" will offer a possibility to
>show the part, which would be otherwise hidden.

If html is not going to be converted to plain text, could you please rename this option "Prefer plain text"? As it stands, it makes it seem like there will be a conversion. I think it would be good to change it to something like "Present html message components as attachments" or "Plain text when available" or whatnot. 

Is it, from a technical viewpoint, not feasible to open a pipe, and use html2text to perform the conversion (which preserves tables quite well)? 
I realise this adds a dep on an external python program...

In case anyone is still reading :) I, in my brief several minutes of reading, do note that some glib programmers have done similar things with SSH streams and glib IO channels [1]

Thanks for taking the time to look at this bug
Comment 12 Matthew Barnes 2009-08-06 14:06:48 UTC
Converting the combo box in Preferences to radio buttons and using more verbose descriptions for each choice would not be a bad idea.
Comment 13 Milan Crha 2009-10-16 10:08:23 UTC
Created commit be17ff0 in evo master (2.29.1+)

Slightly modified patch, with added info label, with a little description. I didn't want to convert combo to radio, even there seems to be enough space, but who knows, maybe after some time, the space will have its occupant. Feel free to suggest better texts.
Comment 14 Milan Crha 2009-10-29 18:09:11 UTC
*** Bug 570931 has been marked as a duplicate of this bug. ***
Comment 15 Matthew Barnes 2009-10-29 18:32:17 UTC
After re-reading bug #570931, I thought of a possibly clearer wording for the options:

    Show HTML if present

    Show plain text if present

    Only ever show plain text
Comment 16 D Haley 2009-10-29 23:23:08 UTC
Maybe change the last one to "Do not show HTML inline " ?
Comment 17 Milan Crha 2009-10-30 13:03:47 UTC
I changed the wording as requested in comment #15 within bug #583450. Note the options have a little description label under the dropdown combo, thus it should be slightly more clear what it means.