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.
Advice on how to treat Html email received
1 Post
Advice on how to treat Html email received

Hello,

I have developed an email receiver (Rails 2.1.2 Tmail +MMS2R) to handle email received adn to display them on my website. For the moment I take the "plain/text" part but I would like to process the html part in order to display the formattted message on my website. I was wondering what was the best way to do that in order to have a "nice" and secure display.

I thought of taking the part inside the body tags and then display with a white_list but the issue is that lot of unpredictable tags will be escaped (and I havent found a good regexp to do that, yet).

Any thought, experience on this problem will be welcomed

Thanks Nicolas

1 Post
Login to add your message