Opened 11 years ago

Closed 10 years ago

#152 closed task (fixed)

HTML-mails content not stored in description of ticket

Reported by: hju@… Owned by: anonymous
Priority: critical Milestone: release 2.0.0
Component: email2trac Version:
Keywords: Cc: olle@…


We encountered a new problem with html-mails. The mail-content is not transfered in the ticket description. (It is a new installed version of email2trac under windows...)

No problems till now with html-mails under the old installation (0.3)

Example: Looks like ticket #135

Any idea?

Attachments (0)

Change History (35)

comment:1 Changed 11 years ago by bas

  • Status changed from new to assigned

Just for clarity is the HMTL version not added as attachment to the ticket? If it is this the normail behaviour.

comment:2 Changed 11 years ago by hju@…

Yes, the HTML-Version is attached as untiteled-part.2.html

So the different behaviour was a "bug" in our old version? (Got HTML-Attachment plus text!)

If it is this the normail behaviour.

OK, but this is not very friendly to use!

Instead of reading the description you must:

  • click on the attachment
  • click on download...
  • click on "OK" in the Dialog Box

Is there any way to get a Text-Version of the Mail instead of the html-attachment? (as an option: CONVERT_HTML_TO_TEXT: 1)

comment:3 Changed 11 years ago by bas

Your right it is not friendly. Maybe we have some utility that converts the html mail. Just a note:

  • html messages an contain images and other strange tags
  • people can sent multipart messages that also can contain html messages. So we have to parse all of them.

Or do you have a solution for html messages

comment:4 Changed 11 years ago by hju@…

Or do you have a solution for html messages

Not yet... (and I'm no mail-specialist)

But I'll have a look at our "old" version (0.3)

# html messages an contain images and other strange tags

Thats right. But in version 0.3 of email2trac, the text and images of a html-mail were (accidently?) converted into Description and Attachments (HTML-Text and Images)

comment:5 Changed 11 years ago by hju@…

Hy Bas,

I've looked around a little. Maybe we got the description because the sending mailer includes both, text/plain and text/html?

There is a HTML-Parser in Python (since 2.2) which can hopefully be used to translate the html-body auf these mails.

Also I found some examples for converting HTML to Text

I think the best way should be: (if CONVERT_HTML_TO_TEXT is true)

  • .walk through the email as you do
  • if there is a text/plain part, use it for description (some mailers add both, text/plain and text/html)
  • if no text/plain, convert text/html to text and build description
  • inline grafics should be attached
  • links should be added as a list(or: converted to WikiFormatting in text)

What do you think? It's just a snap for you, isn't it?

comment:6 Changed 11 years ago by basv@…

That is the situation in most cases text and html. Thanks for the
pointers for HTML conversions.
When i message is send in text and html is marked as alternative. In
1.0.0 there is an option to drop the html version. So it is not
attached to the ticket.

Your steps are logical and some are already implemented. I have to
plan some time for it. Currently i am a  bit swamped in other
projects. So it will take some time to implement.

Bas van der Vlies

comment:7 Changed 10 years ago by olle@…

  • Cc olle@… added
  • Version changed from 0.80 to 1.6.0

+1 on this. All users that have Outlook (99% in our organisation) send (html) mails that ends up as an attachment. It creates alot of extra work for us that deals with Trac (and confusion for the user that is coming back to look at his/her ticket). The description/message appears as an attachment named "None". We use Outlook 2010. Trac runs on Ubuntu.

Our users appreciate the fact that they don't have to use the Trac-interface, so I'd hate to remove this feature for them.

Email that comes from Apple Mail (1%) works like a charm!

comment:8 follow-up: Changed 10 years ago by bas

Apple mail sent both in plain text and html, Outlook only html that is the root cause of the problem. I am alwys open for patches ;-)

comment:9 Changed 10 years ago by anonymous

I would if I could :) I'm not a developer, but I'd be happy to pay $50 for this feature if that makes a difference!

comment:10 in reply to: ↑ 8 Changed 10 years ago by hju@…

Replying to bas:

Apple mail sent both in plain text and html, Outlook only html that is the root cause of the problem.

I would if I could :) I'm not a developer,

Well, it seems that Outlook may be configured to send html AND plain text too. I sometimes receive mails from an Microsoft Exchange V6.5 Server which contain both. I'm sorry but I don't know ho to configure it, but perhaps it is worth to have a look at it.

comment:11 Changed 10 years ago by bas

  • Version 1.6.0 deleted

That is true Outlook can send mail in html and text. The most people only have html format configured. And email2trtac an not handle html email, only as attachment. Maybe i gonna use the command line 'html2text' to convert it. I do not know if it is available on Windows.

comment:12 Changed 10 years ago by bas

  • Type changed from defect to task

comment:13 Changed 10 years ago by bas

I just tied the html Trac wikiproccessor. But that does not work. I have to strip a lot of html tags before i get some text in the ticket

comment:15 Changed 10 years ago by bas

the output is a bit weird. But it could work. There are several other utilities that accomplish the same result. So maybe we have to use external program or internal that only supports a subset

comment:16 Changed 10 years ago by anonymous

Hmm. I've been looking at the code of those emails being sent and it seems like Outlook 2010 is actually including a text-version separate to the html version. Hmm.

Content-Type: text/plain; charset="iso-8859-1"
Content-Type: text/html; charset="iso-8859-1"

comment:17 Changed 10 years ago by bas

Can you attach an raw exampe. If you set debug level it will save the raw email. So i can easily test it.

comment:18 Changed 10 years ago by anonymous

I've set debug=1, but the attachment (filename: None) looks the same without debug. I did reload apache before testing.

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="" xmlns=""><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
	panose-1:2 15 5 2 2 2 4 3 2 4;}
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
a:link, span.MsoHyperlink
a:visited, span.MsoHyperlinkFollowed
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=SV link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Does this text show?<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Verdana","sans-serif";color:#C90019;mso-fareast-language:SV'>Eva L</span></b><b><span style='font-size:9.0pt;font-family:"Verdana","sans-serif";mso-fareast-language:SV'><o:p></o:p></span></b></p><p class=MsoNormal><span style='font-size:7.5pt;font-family:"Verdana","sans-serif";color:black;mso-fareast-language:SV'>Event<br><b><br>Kvadrat Stockholm AB</b><br><b>Sveavägen 90, 7tr</b> Besöksadress<br><b>Box 45002, 104 30 Stockholm</b> Postadress<br><br><b>08-419</b> Telefon<br><b>08-62</b> Telefax<br><b>070-51</b> Mobil</span><span style='mso-fareast-language:SV'><o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>

comment:19 Changed 10 years ago by bas

what version do you use and on which os? I must have the raw email. It is sometginh like:

  • tmp*,email2trac

Tis file is just the email message that is being parsed by enail2trac

comment:20 Changed 10 years ago by anonymous

Outlook 2010, Windows 7. I just sent you an email with the raw email attached. I'm using Apple Mail myself.

comment:21 Changed 10 years ago by bas

To whom did you send it? It is not in this ticket.

comment:22 Changed 10 years ago by anonymous

basv at sara dot nl Didn't want to share the raw content of that email with everyone.

comment:23 Changed 10 years ago by bas

ok. That i have to wait. Did not receive it yet. or it is blocked. You can also upload it to the and put in the pub/incoming directory.

comment:24 Changed 10 years ago by anonymous


comment:25 Changed 10 years ago by howmuch@…

I'm having a similar set of problems and getting asked by management to fix it. Is there any progress on this? If not, I'd be happy to work on it myself.

comment:26 Changed 10 years ago by bas

I have some ideas but not had the time to do it and its not that easuas it sounds. I am always open for patches and code contributions ;-)

comment:27 Changed 10 years ago by olle@…

I'd be happy to contribute with testing and feedback! I've noticed it's quite hard to get users to remember/select "send as plain text" in Outlook :)

comment:28 Changed 10 years ago by anonymous

Any news, Bas?

comment:29 Changed 10 years ago by bas

Not from my side. I am a bit busy with migration projects

comment:30 Changed 10 years ago by bas

  • Milestone set to release 1.7.0

Just a question on which os is trac installed. For Linux we could use:

  • html2text

I just did a raw implementations and it seems to work.

comment:31 Changed 10 years ago by bas

(In [498]) added support for html to text conversion, in email2trac.conf:

  • html2text_cmd: /usr/bin/html2text -nobs

see #152

comment:32 Changed 10 years ago by anonymous

  • Owner changed from bas to anonymous
  • Status changed from assigned to new

I am now testing the HTMLParser python modules. amd i think i will switch to use this module instead of html2text which is an external program

comment:33 Changed 10 years ago by olle@…

Super! Let me know if you need any testing done.

comment:34 Changed 10 years ago by bas

The code to convert html to text is already in the trunk version. But that uses the html2text command. So you could test that.

comment:35 Changed 10 years ago by bas

  • Resolution set to fixed
  • Status changed from new to closed

Add Comment

Modify Ticket

Change Properties
as closed The owner will remain anonymous.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.