Commit Graph

51 Commits

Author SHA1 Message Date
Christophe Simonis 5e7f143c21 [MERGE] forward port of branch saas-3 up to ed76b2a 2015-06-11 13:00:49 +02:00
Christophe Simonis ed76b2a782 [MERGE] forward port of branch 7.0 up to e470385 2015-06-11 12:46:06 +02:00
Jean-Baptiste Quenot 3d35a5d42b [FIX] mail: Strip In-Reply-To header
For emails sent via Office 365, reply-to header could contains additional spaces
or get multiline header.
e.g.:
In-Reply-To:
	<4ba8f246904b4fedb49fbab7945a7f82@AM3PR06MB433.eurprd06.prod.outl$$k.com>

The message lookup fails if header is not stripped
2015-06-03 19:12:12 +02:00
Denis Ledoux 87dd06c941 [MERGE] forward port of branch saas-3 up to 8c150c6 2015-01-15 14:43:32 +01:00
Denis Ledoux a692c6e934 [MERGE] forward port of branch 7.0 up to f406847 2015-01-15 11:49:28 +01:00
Olivier Dony 005e24fada [FIX] mail.thread: correct matching when finding author + test
The previous matching rules were too fuzzy and allowed random
prefix-match or tail-match of other user's emails.
For example when looking up a partner matching 'foo@bar.com'
the system would sometimes find 'dom.foo@bar.com' instead,
or 'foo@bar.com.tw'.

Fixed by only allowing direct case-insensitive email match
of an addr-spec, or substring match of the addr-spec enclosed
in angle brackets, within a name-addr pair.
See also RFC5322, section 3.4

Also adapted related message_find_partner_from_emails() method
to factor out the partner email resolution mechanism to avoid
the same problem.

Adds corresponding regression test.
2015-01-07 17:50:42 +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
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
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Olivier Dony fb19b54ff9 [MERGE] Forward-port of 7.0 bugfixes up to rev 9976 rev-id: odo@openerp.com-20140411142429-y0rpkzqbrsabxqsg
bzr revid: odo@openerp.com-20140411142800-t8sbcmfkj3qgmrh3
2014-04-11 16:28:00 +02:00
Olivier Dony 9861b5cada [FIX] mail.thread: avoid overwriting thread_id/model with foreign values when reply-to hostname does not match + fix tests
This improve previous commit by making sure we
never consider the thread_id/model values in the
In-Reply-To/References header if the host name
did not match.
Also fixes the tests that were using the
6.1 compatibility mode to post in a mail group
thread instead of specifying the right
message-id.

bzr revid: odo@openerp.com-20140411142429-y0rpkzqbrsabxqsg
2014-04-11 16:24:29 +02:00
Olivier Dony 0227d6a056 [FIX] mail: adapt `assertRaises` test after corresponding code change in last forward-port
bzr revid: odo@openerp.com-20140217095143-ibhqyzflle2hbimy
2014-02-17 10:51:43 +01:00
Olivier Dony 76d89c0477 [MERGE] Forward-port of latest saas-2 bugfixes, up to rev. 9133 dle@openerp.com-20140214131810-9abebxpfeoga1crn
bzr revid: odo@openerp.com-20140217091203-kmeg4qsn2qyvll23
2014-02-17 10:12:03 +01:00
Denis Ledoux 0ef17beed0 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9846 revid:dle@openerp.com-20140217124044-o8sgz1esfqeha01f
bzr revid: dle@openerp.com-20140214100922-m6rf7c6x85nv67sl
bzr revid: dle@openerp.com-20140214114713-oab4kbearvv7g3nh
bzr revid: dle@openerp.com-20140214131810-9abebxpfeoga1crn
bzr revid: dle@openerp.com-20140217124230-ov201kfep88f5tn7
2014-02-17 13:42:30 +01:00
Thibault Delavallée e09f5cd264 [FIX] mail: fixed tests, no more assertionerror, but valueerror
bzr revid: tde@openerp.com-20140212153141-ajwmd26of69tfoer
2014-02-12 16:31:41 +01:00
Thibault Delavallée 89bc58bae6 [TESTS] mail: mute logger back in mail tests
bzr revid: tde@openerp.com-20131209160923-3yisgzqmns6pviud
2013-12-09 17:09:23 +01:00
Thibault Delavallée 8253453d64 [IMP] mail: mail_thread: routing: implement compat-mode routing
It now accepts <111...222..openerp-res_id-model@mydomain.com> partial matching
only if the target record has messages without message_id, aka <= 6.1 record.

Updated and added tests

bzr revid: tde@openerp.com-20131128133226-ce1qyeswi9n83q8v
2013-11-28 14:32:26 +01:00
Thibault Delavallée b35a44f66d [IMP] mail_mail, mail_message: various improvements to try to improve message creation time
Replaced some read by browse
Moved get_reply_to from mail_mail to mail_message
Hint: specifying email_from, reply_to help to enhance computation time

[REF] mail: cleaned some tests, renamed a file, moved mail_group tests into a dedicated file

bzr revid: tde@openerp.com-20130827133058-ko0g0ib0f0jihmdk
2013-08-27 15:30:58 +02:00
Christophe Simonis 5343c48c5f [MERGE] forward port of branch saas-1 up to revid 8760 chs@openerp.com-20130823143114-83tdjhbsdes0kydr
bzr revid: chs@openerp.com-20130823154655-blm2wyfivmg8qi2z
2013-08-23 17:46:55 +02:00
Christophe Simonis 58868227f9 [MERGE] forward port of branch 7.0 up to revid 9382 chs@openerp.com-20130823131214-ipouwtnz8r16mlvv
bzr revid: chs@openerp.com-20130823143114-83tdjhbsdes0kydr
2013-08-23 16:31:14 +02:00
Thibault Delavallée d874d9980d [FIX] mail: fixed wrong parsing of multipart/mixed emails.
alternative mode is computed when browsing the parts, not from
the message content type.

Added tests.

Also added some notification_email_send to none to avoid sending
emails in demo/data/update.

bzr revid: tde@openerp.com-20130823120611-0n4ull3c8gvwug2u
2013-08-23 14:06:11 +02:00
Thibault Delavallée c998b86a46 [CLEAN] mail: tests: cleaned test_mail_gateway file about indentation
bzr revid: tde@openerp.com-20130807142928-ocgzim1hdi95uyby
2013-08-07 16:29:28 +02:00
Thibault Delavallée 2eece10cd4 [FIX] mail_mail: computation of reply_to after create to avoid
interfering with automatic message_id creation of mail_message
[FIX] mail_thread: fixed issues with private messages through mailgateway
(wrong route checking, variable erasing)
[TEST] mail: added test for the second bug

bzr revid: tde@openerp.com-20130807142418-3h5qxdt3ekosj9x6
2013-08-07 16:24:18 +02:00
Thibault Delavallée fd90140d7b [REF] mail_thread: refactored message_route improvement, to be closer to the original code + call to a new method that checks the route, instead of doing everything in one method.
bzr revid: tde@openerp.com-20130624151827-hxwaelefs540pvca
2013-06-24 17:18:27 +02:00
Thibault Delavallée 7b7dfb955f [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20130617095141-74uttqtw60iorl5g
2013-06-17 11:51:41 +02:00
Christophe Simonis 484148e8e4 [FIX] mail: compare splitted email in tests
bzr revid: chs@openerp.com-20130614114258-iar6h3ctaaqrb4on
2013-06-14 13:42:58 +02:00
Christophe Simonis aa133b4d29 [MERGE] forward port of branch saas-1 up to revid 8745 chs@openerp.com-20130613181503-82234mo34wxb0oap
bzr revid: chs@openerp.com-20130614091924-z5ta02kwhmwcrgox
2013-06-14 11:19:24 +02:00
Thibault Delavallée fc44f25d3a [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20130612123429-a4mp0wiicdhlvk0m
2013-06-12 14:34:29 +02:00
Thibault Delavallée 636c793c70 [TESTS] mail: added tests
bzr revid: tde@openerp.com-20130607091619-tfh78a1agqdiqc23
2013-06-07 11:16:19 +02:00
Martin Trigaux a5698b8016 [IMP] mail: better tests for gateway
bzr revid: mat@openerp.com-20130606125046-0f0sj5u64blqxbrs
2013-06-06 14:50:46 +02:00
Martin Trigaux d0202ffb19 [IMP] mail: remove unecessary write in test
bzr revid: mat@openerp.com-20130605152316-tnd9oilxq7910061
2013-06-05 17:23:16 +02:00
Martin Trigaux 1482ce563f [FIX] mail: fix emails to adapt changes in saas (you ruined my afternoon tde)
bzr revid: mat@openerp.com-20130605151039-ps29tnqmn5pilxz4
2013-06-05 17:10:39 +02:00
Thibault Delavallée 3f5c738084 [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20130522110325-hos9ocph7yo9ae7w
bzr revid: tde@openerp.com-20130522143206-uv1f6lj6xsenzj6u
2013-05-22 16:32:06 +02:00
Thibault Delavallée cd278d83ab [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20130522103305-yi5ql1chdx9qxxlx
bzr revid: tde@openerp.com-20130522114236-qi2s3i2dl2lemdvh
2013-05-22 13:42:36 +02:00
Thibault Delavallée 2f2d833a4a [TEST] mail: added and fixed tests
bzr revid: tde@openerp.com-20130517151321-9qu4bw6222lx3pa2
2013-05-17 17:13:21 +02:00
Thibault Delavallée f3f2d72e04 [REV] [IMP] mail: mail.catchall.alias is now only a system parameter; removed from configuration (because much too technical) + udpated tests that could crash on an existing instance.
bzr revid: tde@openerp.com-20130517131109-aosyv23p7rz5sjg5
2013-05-17 15:11:09 +02:00
Thibault Delavallée 88e3505554 [IMP] mail_alias: added reference to the parent record.
The parent record is the record that holds the alias. It is different
from the record updated or created using the alias. For example
projects have aliases whose parent is the given projet, and that creates
new task inside the project.
Updated alias creation and management accordingly.
This ownership concept is used to compute the 'followers' contact
settings of aliases.

bzr revid: tde@openerp.com-20130516164207-1zr0q6abw6a34ndf
2013-05-16 18:42:07 +02:00
Thibault Delavallée bc4964de13 [IMP] mail: now defines a catchall email alias, used to format the
reply_to of notification emails when having a document without alias, or for
private discussions using external mail readers.

bzr revid: tde@openerp.com-20130516150900-khb1d1ygyuos1wrl
2013-05-16 17:09:00 +02:00
Thibault Delavallée 0dada27fcd [MERGE] Revisions 8997 ... 8999 of 7.0 branch.
bzr revid: tde@openerp.com-20130426132721-02lkoc41fms9ve1k
2013-04-26 15:27:21 +02:00
Thibault Delavallée a75cc23573 [REF] mail: refactored system to generate links in signatures. A new server action is used that choose to redirect to the document or to the Inbox (Portal or Classic Inbox, depending on the user).
bzr revid: tde@openerp.com-20130417122225-faf0bb5vyhbcx7ys
2013-04-17 14:22:25 +02:00
Thibault Delavallée 7f6a475590 [IMP] [REF] mail_thread: refactored a bit message_parse, message_route and various find_partner methods.
Now handles private aliases (alias_contact as partners or followers).
message_route now works in 2 steps :
1/ finding all possible routes, as before
2/ checks and filtrates those routes, by finding the most
relevant message author and using it to check alias contact settings.
Also refactored the various partner finding method in one method
that checks in res.partner, for: partners, partners that are users,
partners that follow a given document.

bzr revid: tde@openerp.com-20130416132813-zcm1r5kx0dwrfeic
2013-04-16 15:28:13 +02:00
Thibault Delavallée f35246e81c [MERGE] Sync with trunk, to benefit from freshly forward-ported 7.0 bugfixes.
bzr revid: tde@openerp.com-20130411082704-qce7e1moyo2sxz0c
bzr revid: tde@openerp.com-20130411141158-lk7lsf2haqbjit1u
2013-04-11 16:11:58 +02:00
Thibault Delavallée f994529725 [IMP] mail: finding partner based on email: improved code for suggested partners, added somme comments and tests.
bzr revid: tde@openerp.com-20130411101720-mumz152dsxvv1xbj
2013-04-11 12:17:20 +02:00
Thibault Delavallée 37bec9643d [FIX] mail: fixed recipients of private discussion, that were not correct. Author could be notified of their own reply independently of the specified recipients. Added tests for private discussions.
bzr revid: tde@openerp.com-20130403121307-4rixx7ct6y86spoz
2013-04-03 14:13:07 +02:00
Thibault Delavallée dbaeee703f [IMP] mail: alias_contact on alias. However, not sure this will be usefull, to discuss.
bzr revid: tde@openerp.com-20130322155734-9jfc7w8nw8oiytd4
2013-03-22 16:57:34 +01:00
Thibault Delavallée 4ebbf0e58d [IMP] mail: cleaned some tests, assertTrue on the length of a list replaced by assertEqual.
bzr revid: tde@openerp.com-20130322141022-j26c1hiwfoduky2j
2013-03-22 15:10:22 +01:00
Thibault Delavallée 6cfb01d7c9 [FIX] mail: message_process: do not process incoming emails with a message_id already existing in database.
Before trying to find possible routes, check that the incoming email's
message_id is not already present in mail.message table.
If it is the case, return False.

Parsing of the message has been moved before routing, to avoid looking
for routes for emails we will discard.

Tests have been added and updated.

bzr revid: tde@openerp.com-20130322124809-ven2p5kxpqfjqxb5
2013-03-22 13:48:09 +01:00
Thibault Delavallée 30a1d99d07 [MERGE] Sync with trunk + fixed the fix and tests.
bzr revid: tde@openerp.com-20130320161045-41bpe36b09tgcxpo
2013-03-20 17:10:45 +01:00