Commit Graph

111 Commits

Author SHA1 Message Date
Denis Ledoux 7f29a23118 [FIX] tools: email TLDs can be longer than 6 chars
According to the RFC1034
https://tools.ietf.org/html/rfc1034

A TLD can use up to 63 octets.

The regex checking that an email address is valid
should there allow emails using a TLD with such a length.

Besides, the use of TLD domains exceeding 6 characters is more
and more common, nowadays.

e.g. using a domain `.amsterdam`

opw-660014
2015-12-16 17:11:08 +01:00
Thibault Delavallée 3f758e2fab [FIX] tools, mail: do not strip name from email_to
When sending a mail.mail with email_to, the processing split the email_to into
a list of addresses. However if the found addresses use the form name <email>
the name if lost in the process. A new email_split_and_format method is introduced
in tools and used to avoid loosing that information.
2015-12-11 11:22:40 +01:00
Christophe Simonis 83a4a582fa [MERGE] forward port of branch saas-3 up to 513cea6 2015-12-08 12:28:41 +01:00
Christophe Simonis 47b2f7ea9e [MERGE] forward port of branch 7.0 up to 3a1c693 2015-12-08 12:16:00 +01:00
Denis Ledoux 31e8bb8e9d [FIX] mail: better signature detection
This revision back-ports revisions
983d5eb9fa
&
ccbb8e09a6
regarding this signature regex.

Besides, it adds the fact the dashes have to
be at the beginning of the line
to make them detected as a signature.

opw-655834
2015-11-30 14:48:59 +01:00
Christophe Simonis 35233dbbe2 [FIX] core: tools.html_sanitize: allow svg images 2015-09-11 16:42:47 +02:00
Nicolas Lempereur 10c6fe4a6c [FIX] mail: make read more term translatable
opw-631860
2015-03-31 12:16:33 +02:00
Olivier Dony 13476c844d [FIX] fields.html, forum: opt-in stripping of @style attrs
For public-facing HTML content provided by the user,
`<style>` tags and `style` attributes should be stripped
automatically, as they can easily be abused to deface
pages for abusive users and spammers.
<style> tags were already stripped, the optional `strip_style`
for fields.html enables the automatic stripping of style
attributes.

This is opt-in because custom style attributes are still
desirable in trusted HTML fields.
2015-03-09 14:41:14 +01:00
Christophe Simonis 2e3f59181d [MERGE] forward port of branch saas-3 up to db75994 2014-10-14 15:13:14 +02:00
Olivier Dony edd94b623e [MERGE] Forward-port 7.0 up to 1b49a87 2014-10-10 19:21:18 +02:00
Martin Trigaux bd52298073 [IMP] mail: parsing emails with several html parts
If an email contains several text/html parts inside a multipart email, the previous code was only keeping the last content part.
The Content-Type: multipart/mixed allows several independent part (RFC1341 7.2.2), so two html is technically valid.
With this patch, the two parts are concatenated. (opw 614755)

Modify append_content_to_html regex to make sure the regex keeps the content of the html instead of removing it.
e.g.: "123 <html> 456 </html> 789" used to be stripped to "123  789" while we expect "123 456 789"
2014-10-09 13:53:23 +02:00
Christophe Simonis 780dd9891f [MERGE] forward port of branch saas-5 up to 7eab880 2014-09-15 14:00:02 +02:00
Christophe Simonis 56f2b7ae0f [MERGE] forward port of branch saas-3 up to fdc6271 2014-09-12 18:53:48 +02:00
Denis Ledoux e447a46ec8 [MERGE] forward port of branch 7.0 up to 33e0910 2014-09-09 18:02:30 +02:00
Denis Ledoux d824769b3c [FIX] tools,mail: improve parsing of references from rev. 0bee015dd6
Backport of 8.0 fix was not enough for 7.0, because it still fails for the legacy reference match (model+res_id), which is not used in 8.0
2014-09-05 11:44:20 +02:00
Martin Trigaux 80d8532370 Forward port of branch saas-5 up to rev 4895281e 2014-08-22 09:12:14 +02:00
Martin Trigaux 15a3a2a63a Forward port of branch saas-3 up to 7bcefaf 2014-08-21 18:14:22 +02:00
Martin Trigaux 7bcefaf232 Forward port of branch 7.0 up to 0ab88f5 2014-08-21 17:57:57 +02:00
Desai Binjal 8fe9f07cac [FIX] note: small bugs 2014-08-21 15:55:23 +02:00
Thibault Delavallée a76de4595e [FIX] tools: mail: fixed read more link tha could be placed in a block to be removed, being considered as a quote 2014-08-20 14:10:20 +02:00
Thibault Delavallée c64b077362 [FIX] mail: fixed bounce email recognition + invite email headers + mass mailing statistics not lost anymore
- [FIX] bounce regex: too many emails were considered as bounce and therefore
not displayed in the chatter and lost for the communication history. The regex
was not correctly looking for the bounce alias in the email_to.
- [FIX] invite email: replying to the invitation email (invitation as new
follower) now replies to the user sending the invitation.
- [FIX] mass_mailing: added a column to store the id of the original email
in addition to the many2one column. The many2one is set to null when deleting
the original email. As the information is necessary, it is saved on another
field. The many2one is necessary for indexes purpose as the inverse of
a one2many.
2014-08-11 15:39:26 +02:00
Thibault Delavallée f5688cd8fd [FIX] tools: html_sanitize: keep mako tags (<% ... %>), required for example in the portal sale quotation email. 2014-08-07 16:47:58 +02:00
Christophe Simonis de696f14f8 [MERGE] forward port of branch saas-3 up to 24484c8 2014-07-15 10:38:14 +02:00
Christophe Simonis 24484c8bcd [MERGE] forward port of branch 7.0 up to 7a928b1 2014-07-15 10:36:54 +02:00
Thibault Delavallée 7a928b151a [FIX] tools: mail: fixed last commit, solving an issue with the html2plaintext introduced another issue with notes. Reverting to the first version. 2014-07-11 16:21:01 +02:00
Olivier Dony e31fd6a1e1 [MERGE] Fwd-port saas-3 up to a9d2b65 2014-07-11 11:53:07 +02:00
Olivier Dony a9d2b65da5 [MERGE] Fwd-port 7.0 up to 783b9e1 2014-07-11 11:51:06 +02:00
Anand-Dharampuriya 5cbc611361 [FIX] Solve some mail issues which are currently present in 7.0 2014-07-10 16:29:54 +02:00
Christophe Simonis c16780df83 [MERGE] forward port of branch saas-3 up to revid 5120 chs@openerp.com-20140424125338-26k5atvtqwmmfv4e
bzr revid: chs@openerp.com-20140424131405-4oannh1102x42m8b
2014-04-24 15:14:05 +02:00
Martin Trigaux 901bb47235 [MERGE] [IMP] mail sanitizer: do not remove comments in html body when cleaning (and do not remove too many content) (opw 605315)
bzr revid: mat@openerp.com-20140423131919-q3vbw12tokglwdsq
2014-04-23 15:19:19 +02:00
Anael Closson 1528f9273b [FIX] tools: Comments in e-mail templates are removed before mako/jinja2 processing - opw 605315
bzr revid: acl@openerp.com-20140415143736-bcgwgribsv2hsbvo
2014-04-15 16:37:36 +02:00
Raphael Collet e5e00e4c0a [IMP] registry: now cursor() simply returns a cursor, which may itself be used as a context manager
bzr revid: rco@openerp.com-20140409095604-joh9dt0qkma12ykm
2014-04-09 11:56:04 +02:00
Raphael Collet 6bc60505f4 [IMP] registry: add method get_cursor() to simply retrieve a new cursor, and refactor code to use it
bzr revid: rco@openerp.com-20140408125122-ki0zmin3m21k2itd
2014-04-08 14:51:22 +02:00
Martin Trigaux e328c0a40e [FIX] html_sanitize: partial backport of trunk revision 5047.
Unescape elements that have been wrongly escaped.

Some elements (eg: 'href' tag in links) are sanitised in templates which prevents the execution of mako templates.

lp bug: https://launchpad.net/bugs/1273251 fixed

bzr revid: mat@openerp.com-20140210144023-9sp8cqn07ta5o64y
2014-02-10 15:40:23 +01:00
Thibault Delavallée 2bcf4cca79 [FIX] tools: mail: support \[ and \] in tmeplates
bzr revid: tde@openerp.com-20140123152842-21b3gsey1mxt4v37
2014-01-23 16:28:42 +01:00
Thibault Delavallée 69af79ff3d [FIX] tools: mail: fixed last commit, now simply using replace
bzr revid: tde@openerp.com-20140123141435-jstfcaemjplbn7b1
2014-01-23 15:14:35 +01:00
Thibault Delavallée 5f1ec49ecd [FIX] tools: mail: when cleaning, unescape mako specific symbols.
Indeed those are escaped when contained inside an href or mailto element
of a tag, leading to mako not rendering the element.

bzr revid: tde@openerp.com-20140123125137-4u4i88f1ajybg5f2
2014-01-23 13:51:37 +01:00
Thibault Delavallée ab5c23079a [MERGE] Sync with trunk, solved conflicts.
bzr revid: tde@openerp.com-20140116091716-zk1n5ots94i65io5
2014-01-16 10:17:16 +01:00
Christophe Simonis a69f789b41 [MERGE] forward port of branch 7.0 up to revid 5224 chs@openerp.com-20140206105141-7e8bv8ordqqsswh7
bzr revid: dle@openerp.com-20140205105045-j95kduyjiq83e57z
bzr revid: dle@openerp.com-20140114173613-ruxye1m7fxtcjfim
bzr revid: dle@openerp.com-20140116161158-u95vcs3os4tk2zob
bzr revid: dle@openerp.com-20140121172737-gzawfi3ssg7xifef
bzr revid: chs@openerp.com-20140129094554-c3abc8x3qz9mpszr
bzr revid: chs@openerp.com-20140129140159-9vwkpr078shoonum
bzr revid: chs@openerp.com-20140206110220-myn57cryam1y4k9v
2014-02-06 12:02:20 +01:00
Thibault Delavallée c63ffed24d [IMP] tools: mail: the cleaner, by parsing and serializing the html content,
encapsulatse the whole content inside a div. This means that html fields are
not editor-clean after being sanitized, because a div has been inserted as root
element. Removing this element allows to have snippets that can be dragged,
dropped, or to insert new snippets inside edited html content in html fields.

[IMP] tools: tests: mail: updated a test accordingly

bzr revid: tde@openerp.com-20140115142709-e4951b4nc06sfxf0
2014-01-15 15:27:09 +01:00
Thibault Delavallée 2c4600f242 [IMP] [READD] [IMP] tools: mail: have a strict mode for html_sanitizer (not default) with
options before website: without frames, with safe attributes only.
We will have to find a way to use the strict mode when parsing incoming
emails, but not when sending or storing openerp content.

Currently the not strict mode is the default one, to avoid side-effects with
the website.

bzr revid: tde@openerp.com-20140115141319-g15zl1kqrp8sgoa3
2014-01-15 15:13:19 +01:00
Olivier Dony 7a819ca8d0 [FIX] tools.email_split: improve email extraction using stdlib + extra tests
The original code was having issues telling apart
names containing emails from the actual email.
This patch is inspired by Etienne Hirt's patch
on bug 1165531 for OpenERP 6.1.
This will also help solve bug 1199386, if we can
centralize all email parsing through this helper.

lp bug: https://launchpad.net/bugs/1199386 fixed
lp bug: https://launchpad.net/bugs/1165531 fixed

bzr revid: odo@openerp.com-20140114154426-usu6intv5139egd3
2014-01-14 16:44:26 +01:00
Thibault Delavallée fe0af74eab [REV] Reverted last commit.
bzr revid: tde@openerp.com-20140113165423-8nu3838d4yj3h3j4
2014-01-13 17:54:23 +01:00
Thibault Delavallée 94357739bc [IMP] tools: mail: have a strict mode for html_sanitizer (not default) with
options before website: without frames, with safe attributes only.
We will have to find a way to use the strict mode when parsing incoming
emails, but not when sending or storing openerp content.

Currently the not strict mode is the default one, to avoid side-effects with
the website.

bzr revid: tde@openerp.com-20140113085701-f2bzu94cq1z3tl10
2014-01-13 09:57:01 +01:00
Fabien Pinckaers f9e986ecea [IMP] allow frames in blogs (video, ...
bzr revid: fp@tinyerp.com-20131214211309-i2kk3cb60hnp1urz
2013-12-14 22:13:09 +01:00
Fabien Pinckaers 65a5ce8a92 [IMP] HMTL5 main element
bzr revid: fp@tinyerp.com-20131213214157-8ow63hpaii6hdvxl
2013-12-13 22:41:57 +01:00
Fabien Pinckaers 630e9ad64c [FIX] Don't remove data-... attributes like data-snippet-id
bzr revid: fp@tinyerp.com-20131209185406-newaf16v532l146p
2013-12-09 19:54:06 +01:00
Christophe Matthieu 8460122209 [MERGE] sync with trunk
bzr revid: chm@openerp.com-20131202150856-fzrfcoa8pmsjutau
2013-12-02 16:08:56 +01:00
Denis Ledoux 6fd552c3ce [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5139 rev-id: dle@openerp.com-20131121132305-qjlclgz5v9tze1fr
bzr revid: odo@openerp.com-20131120102545-2tlp031yib6viz35
bzr revid: chs@openerp.com-20131120161708-c8sbom592moukwxw
bzr revid: dle@openerp.com-20131121155457-lh7fzouk2upeiu16
2013-11-21 16:54:57 +01:00
Christophe Simonis 7ba1d747cc [FIX] html_sanitize: handle the case of empty documents (after sanitization).
[IMP] test_mail: do not mute logger

bzr revid: chs@openerp.com-20131113113715-tzaog0d6o2u4q0x4
2013-11-13 12:37:15 +01:00