jadolg / webpymail

Automatically exported from code.google.com/p/webpymail
GNU General Public License v3.0
0 stars 0 forks source link

Encoding message part #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The Message.part() method encodes message only if it is TEXT but not HTML. I'd 
like to add to my template the HTML view (I'll use HTML5lib based sanitizer 
http://github.com/riffm/insanities-testing/blob/master/insanities/utils/html.py 
to clean HTML)/ But I cant get decoded part from message with existing methods.

Maybe adding encode flag to Message.part() method is a good solution? It would 
not hurt any existing code.

Original issue reported on code.google.com by akimov.alex on 8 Sep 2010 at 7:14

GoogleCodeExporter commented 9 years ago
I'm trying to remember why I gave this behaviour to the 'part' method :-| 

I did leave a comment mentioning that the html encoding could be specified in 
the html part it self, meaning that the decoding of the part should be done 
further up in the code (for instance at the view level)... I browsed the mime 
RFC but was not able to find a solid reason to do this. Please let this age a 
bit, to see if we can find a good answer.

Original comment by hguerreiro@gmail.com on 13 Sep 2010 at 8:01

GoogleCodeExporter commented 9 years ago

Original comment by hguerreiro@gmail.com on 22 Sep 2010 at 7:50

GoogleCodeExporter commented 9 years ago
I'm going to add a 'force_decode' flag to the 'part' method. I'm interested in 
your efforts to sanitize the html, if you have success let me know! In 
webpymail I'm thinking about creating a tag where this will be done, something 
like:

{% sanitize_html_part <message> <part> %} 

I've found this question in stack overflow that might help: 

http://stackoverflow.com/questions/699468/python-html-sanitizer-scrubber-filter

Original comment by hguerreiro@gmail.com on 27 Sep 2010 at 8:28

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r101.

Original comment by hguerreiro@gmail.com on 27 Sep 2010 at 8:30