<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/openerp/tools/mail.py, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[REF] openerp: move `openerp` to `odoo`</title>
<updated>2016-09-02T15:28:12+00:00</updated>
<author>
<name>Raphael Collet</name>
<email>rco@openerp.com</email>
</author>
<published>2016-09-02T13:58:39+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=9e64f9f9514194d74e166b032add8511182f2677'/>
<id>9e64f9f9514194d74e166b032add8511182f2677</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[REM] mail: remove support of [ID] matching in subject in mail gateway</title>
<updated>2016-09-01T10:57:32+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@openerp.com</email>
</author>
<published>2015-12-11T17:14:58+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=21949937636a2b0fc5b71a2667eede1750e05175'/>
<id>21949937636a2b0fc5b71a2667eede1750e05175</id>
<content type='text'>
This is an old compatibility code. It is time to remove it as it is not used
sinces ages.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is an old compatibility code. It is time to remove it as it is not used
sinces ages.
</pre>
</div>
</content>
</entry>
<entry>
<title>[CLEAN] mail: clean mail gateway code</title>
<updated>2016-09-01T10:23:14+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@openerp.com</email>
</author>
<published>2016-08-17T11:45:57+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=0028c42136f02fcb7a9a81ed5763396290ffdcb8'/>
<id>0028c42136f02fcb7a9a81ed5763396290ffdcb8</id>
<content type='text'>
The purpose of this commit is to clean a bit the code related to email
routing in the mailgateway: message_route and message_route_verify.

message_route is now clearly separeted into two categories. First one
handles emails considered as answers to existing threads. Second one
handles emails that have to create new threads, either through alias or
default behavior of the mailgateway.

message_route_verify has been a bit facotrized to simplify the various
overrides that appeared lately in the codebase.

This commit only contains code cleaning. No functional change should occur
due to this commit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The purpose of this commit is to clean a bit the code related to email
routing in the mailgateway: message_route and message_route_verify.

message_route is now clearly separeted into two categories. First one
handles emails considered as answers to existing threads. Second one
handles emails that have to create new threads, either through alias or
default behavior of the mailgateway.

message_route_verify has been a bit facotrized to simplify the various
overrides that appeared lately in the codebase.

This commit only contains code cleaning. No functional change should occur
due to this commit.
</pre>
</div>
</content>
</entry>
<entry>
<title>[CLEAN] mail, tools: factorize decode email tools</title>
<updated>2016-09-01T08:41:04+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@openerp.com</email>
</author>
<published>2015-12-03T11:59:19+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b259eb69d2085a961c1ad00d8bba3cb8a92123c7'/>
<id>b259eb69d2085a961c1ad00d8bba3cb8a92123c7</id>
<content type='text'>
mail.mail and mail.thread have methods to decode headers. This commit
move them in mail tools. It is indeed simplier to have all email tools
in the same file. Moreover they have been renamed to avoid confusion
with standard library methods: decode and decode_header already exist.

 * decode in mail_message is now decode_smtp_header
 * decode_header in mail_thread is now decode_message_header

A method to data from references is also moved into tools. A regex was
already defined in tools. Now the method using it is already put in tools.
Mailgateway will now simply call this method.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
mail.mail and mail.thread have methods to decode headers. This commit
move them in mail tools. It is indeed simplier to have all email tools
in the same file. Moreover they have been renamed to avoid confusion
with standard library methods: decode and decode_header already exist.

 * decode in mail_message is now decode_smtp_header
 * decode_header in mail_thread is now decode_message_header

A method to data from references is also moved into tools. A regex was
already defined in tools. Now the method using it is already put in tools.
Mailgateway will now simply call this method.
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] tools: sanitizer: decode pipe character</title>
<updated>2016-08-31T14:27:55+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@openerp.com</email>
</author>
<published>2016-08-31T13:46:01+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=275ee5825d38841a3eb21bb195722f3ceed09005'/>
<id>275ee5825d38841a3eb21bb195722f3ceed09005</id>
<content type='text'>
Mako uses pipe character in several occasions like |safe to tell an email is
safe. However the sanitizer will encode it, leading to template not correctly
rendered. Like other special characters used in mako, it is now decoded
after sanitize.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mako uses pipe character in several occasions like |safe to tell an email is
safe. However the sanitizer will encode it, leading to template not correctly
rendered. Like other special characters used in mako, it is now decoded
after sanitize.
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] tools: sanitizer: add and clean sanitize options</title>
<updated>2016-08-30T13:54:56+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@openerp.com</email>
</author>
<published>2016-08-19T11:49:48+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=02c748be59ac8abc44c945218587e7b8a8e06a28'/>
<id>02c748be59ac8abc44c945218587e7b8a8e06a28</id>
<content type='text'>
Now having

 * sanitize: run the sanitizer to clean the html (removing javascripts,
   unwanted tags, ...)
 * sanitize_tags: only a subset of tags is allowed in html content.
   Unwelcomed tags are remove dand their content stripped.
 * sanitize_attributes: only a subset of attributes is allowed.
 * sanitize_style: only a subset of style attributes is allowed. Style
   attributes are parsed to keep only a white list.
 * strip_style: all style is removed. It bypasses sanitize_style as there
   is no need to sanitize something that is removed.
 * strip_classes: remove class attributes

Fields parameters have also been updated to match the sanitize options. Html
fields by default are sanitized with sanitize_tags activated but without any
further options. All addons have been updated to match the new options
according to their previous behavior.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now having

 * sanitize: run the sanitizer to clean the html (removing javascripts,
   unwanted tags, ...)
 * sanitize_tags: only a subset of tags is allowed in html content.
   Unwelcomed tags are remove dand their content stripped.
 * sanitize_attributes: only a subset of attributes is allowed.
 * sanitize_style: only a subset of style attributes is allowed. Style
   attributes are parsed to keep only a white list.
 * strip_style: all style is removed. It bypasses sanitize_style as there
   is no need to sanitize something that is removed.
 * strip_classes: remove class attributes

Fields parameters have also been updated to match the sanitize options. Html
fields by default are sanitized with sanitize_tags activated but without any
further options. All addons have been updated to match the new options
according to their previous behavior.
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] tools: mail: email address escaping</title>
<updated>2016-04-14T12:39:45+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@openerp.com</email>
</author>
<published>2016-04-14T12:06:03+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=f3c9720d42f5ba2caf097b1b83ef6976ef4b498c'/>
<id>f3c9720d42f5ba2caf097b1b83ef6976ef4b498c</id>
<content type='text'>
This commit protects tags having an alt attribute containing an @. Like
cite on blockquote, alt on image for example could contain an @. Do not
escape it as it could break images.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit protects tags having an alt attribute containing an @. Like
cite on blockquote, alt on image for example could contain an @. Do not
escape it as it could break images.
</pre>
</div>
</content>
</entry>
<entry>
<title>[CLEAN] tools, mail: remove html_email_clean</title>
<updated>2016-03-03T14:44:57+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@openerp.com</email>
</author>
<published>2016-03-02T12:58:47+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=ba74e9ffec58011147e92212c0619019d6a28099'/>
<id>ba74e9ffec58011147e92212c0619019d6a28099</id>
<content type='text'>
Remove html_email_clean in tools. Remove shorten in mail.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove html_email_clean in tools. Remove shorten in mail.
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] tools: sanitizer: quote detection</title>
<updated>2016-03-03T14:44:56+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@openerp.com</email>
</author>
<published>2016-03-02T12:58:47+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=cb8c2d2b7e15c7c16e02d078767e27a07e5012c6'/>
<id>cb8c2d2b7e15c7c16e02d078767e27a07e5012c6</id>
<content type='text'>
Quote detection is now done in the sanitizer itself. It tags nodes that are
inside quotes (signature, text quotes, email quotes). The purpose is to remove
html_email_clean and have all the html cleaning / sanitizing inside a single
function. When a node is tagged, data-o-mail-quote is set on the node.
This attribute is added in the whitelist of valid attributes for the
sanitizer.

[REM] Support of shortening messages. The read more / read less will only
display or hide detected quotes and signatures. Shortening messages above
a given amount of characters is not supported anymore. Indeed it adds much
complexity to the sanitizer without adding much value to the result. The
primary purpose of the sanitizer is indeed to remove noise and unnecessary
content.

[TESTS] a lot of test are not necessary anymore, as read more / read less
display will be moved in the front-end and as the shortening has been
removed.Tests have therefore been cleaned and simplified.

[DEMO] mail: small demo update to include a bit quote detection
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Quote detection is now done in the sanitizer itself. It tags nodes that are
inside quotes (signature, text quotes, email quotes). The purpose is to remove
html_email_clean and have all the html cleaning / sanitizing inside a single
function. When a node is tagged, data-o-mail-quote is set on the node.
This attribute is added in the whitelist of valid attributes for the
sanitizer.

[REM] Support of shortening messages. The read more / read less will only
display or hide detected quotes and signatures. Shortening messages above
a given amount of characters is not supported anymore. Indeed it adds much
complexity to the sanitizer without adding much value to the result. The
primary purpose of the sanitizer is indeed to remove noise and unnecessary
content.

[TESTS] a lot of test are not necessary anymore, as read more / read less
display will be moved in the front-end and as the shortening has been
removed.Tests have therefore been cleaned and simplified.

[DEMO] mail: small demo update to include a bit quote detection
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] tools: mail: parse style in sanitizer</title>
<updated>2016-03-02T15:43:22+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@openerp.com</email>
</author>
<published>2016-03-02T12:58:46+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=bfe7aafa7f69671219464f35ba56e34c6f1eb12f'/>
<id>bfe7aafa7f69671219464f35ba56e34c6f1eb12f</id>
<content type='text'>
Style attribute is now parsed and sanitized. Only a while list of accepted
properties is kept. The behavior is implemented directly in the cleaner
itself. As there is no easy possible inheritance, the styling cleaning is
appended directly after the legacy processing in __call__.

The styling sanitizer is called only if the style attribute is kept. If
the sanitizer is called with strip_style=True, the styling is removed
and therefore no sanitizing is performed.

Tests about html fields have been updated. Indeed the styling is now sanitized
and the test was not correct anymore, as the test html was stripped. It now
contains styling that is kept. The strip_classes is also tested.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Style attribute is now parsed and sanitized. Only a while list of accepted
properties is kept. The behavior is implemented directly in the cleaner
itself. As there is no easy possible inheritance, the styling cleaning is
appended directly after the legacy processing in __call__.

The styling sanitizer is called only if the style attribute is kept. If
the sanitizer is called with strip_style=True, the styling is removed
and therefore no sanitizing is performed.

Tests about html fields have been updated. Indeed the styling is now sanitized
and the test was not correct anymore, as the test html was stripped. It now
contains styling that is kept. The strip_classes is also tested.
</pre>
</div>
</content>
</entry>
</feed>
