Welcome to Working With Rails


Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
Tmail cant read MS-Outlook mails perfectly
3 Posts
Tmail cant read MS-Outlook mails perfectly

Hi Amit,

Thanks for your reply. This static substitution will solve the problem but this string pattern is not the only thing that gets inserted. The insertion behavior is not predictable sometimes Outlook inserts "<![if !supportLists]>n <![endif]>" . Writing regular expression is another solution but then the content-type of the mail is html which is creating some problem. What I was actually looking for was a patch to Tmail which fixes this issue. I found one solution in this "post":http://www.blognow.com.au/q/76050/Fix_for_TMail_to_handle_MS_Outlook_MIME_Emails.html but its not working and that patch was for older version of Tmail and I am on rails 2.3.2 so most probably that patch must have been included in new Tmail.I have sent this problem to Mikel - Tmail maintainer and have also posted it in Tmail's mailing list. I am waiting for their response. The last option I have is to write a regexp to fix this.

Do let me know if you have any other idea regarding this.

Thanks, Atul.

Hi Atul

I also faced same problem , i found that outlook add this piece of code

what i did
a= message.to_s a.sub('<!—[if gte mso 9]>

<![endif]—>','') now it will remove ,


Our application (www.qlubb.com) is using Tmail to receive mails. It works perfectly for all the mails, except for MS-Outlook.In case of outlook it adds some text above the body making the message unreadable.

Here is what gets inserted above the body of the mail:

<!—[if gte mso 9]>

<![endif]—><!—[if gte mso 9]>


Here is the header of the test mail:

Message-Id: Subject: This is test mail from Outlook 2007 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=mimepart_4a3106e5b5116_2ce9..fdbed58d6477 X-Server-Quench: 014efb2c-568c-11de-8e8d-001185d377ca X-AuthRoute: OCdwYw4SBVZfSxkc AS4IJDZEVA8vYBZL BAkGMA9GIUINWEQI bwdMdwMUEkAaAgsB A28bWlBeU117WGs7 bA9PbAVcfEtLWhtj UVdLR01SWlttc2hk fk1MUhx7dw1BNnx4 YEQsXnFfCRIodxVg R0hcRnAHZDM1dWhK WBRFdwNVcQtPKhxC bQMuGhdVOCYXPzlw AwIoI3g0NDRbYCpP RQRFCk8ORUEMHXZm H0hddW5h X-Authentic-SMTP: 61633333363736.squirrel.dmpriest.net.uk:1562/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system.

--mimepart_4a3106e5b5116_2ce9..fdbed58d6477 Content-Type: multipart/alternative; boundary=mimepart_4a3106e5b54fd_2ce9..fdbed58d65a4

--mimepart_4a3106e5b54fd_2ce9..fdbed58d65a4 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: Quoted-printable Content-Disposition: inline

<!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri","sans-serif";} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal-compose; font-family:"Calibri","sans-serif"; color:windowtext;} .MsoChpDefault {mso-style-type:export-only;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in;} div.Section1 {page:Section1;} -->

<!—[if gte mso 9]>

<![endif]—><!—[if gte mso 9]>


Fight Club,

Plz check this mail for any garbage data in header.






I would really appreciate any help in fixing this.

Thanks, Atul Veer.

3 Posts
Login to add your message