Commit Graph

832 Commits

Author SHA1 Message Date
Christophe Simonis 31f2a1bc38 [MERGE] forward port of branch 7.0 up to 1c0bc7c 2015-06-30 12:47:27 +02:00
André Paramés 7e0ed740f3 [FIX] mail_thread: correctly handle single id argument in `unlink`
fixes #1721
closes #1723
2015-06-26 15:25:02 +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
Christophe Simonis 12f600cec9 [MERGE] forward port of branch 7.0 up to 35077af 2015-04-01 19:07:59 +02:00
Nicolas Lempereur 35077af57d [FIX] opportunity: salesperson not in followers
Previously, when updating subscribers of a mail.thread, the default_{key}
arguments could override a {key} in the values.

e.g: for an new opportunity, the salesperson was overrided by the default user_id

This fix gives the priority to the values over the default_ in context.

opw-631741
2015-04-01 16:37:01 +02:00
Christophe Simonis 6b70b80a0e [MERGE] forward port of branch 7.0 up to 881c10b 2015-03-25 17:41:53 +01:00
Denis Ledoux 132afa981b [FIX] mail: is_read is the column name in 8.0.
The column 'read' has been renamed 'is_read' in Odoo 8.0.
2015-03-23 15:46:32 +01:00
Denis Ledoux 3235eda781 [FIX] mail: notify parent message on message auto subscribe.
When auto subscribing to a message
(For instance, change the ```user_id``` field on a record,
like an invoice)
The new user is notified of the last message of the thread.
He must be notified of the parent message as well,
to have access to the first message of the thread,
to prevent access rights issues to the thread.

This mechanism is applied in the _notify method
of model ```mail.message``` as well, for the same reasons.

opw-630286
2015-03-23 15:26:41 +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 22c390285f [MERGE] forward port of branch 7.0 up to 78a29b3 2014-10-21 13:06:27 +02:00
Denis Ledoux 1d57a09112 [FIX] mail: set the parent_id to the first message of type email
And fallback of any type if there is none of type email

This fix allow the communication between two mail thread from two different Odoo servers having message creation subtypes, like project issue or crm lead
2014-10-16 14:07:38 +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
Denis Ledoux 2684b7de4c [FIX] mail: alias domain should be fetch as superuser
as ir.config.parameter has limited access
2014-09-10 17:26:39 +02:00
Denis Ledoux e447a46ec8 [MERGE] forward port of branch 7.0 up to 33e0910 2014-09-09 18:02:30 +02:00
Rifakathusen Haradwala f51dac038e [FIX] mail: translate tracked fields name in chatter
Status tracking messages are not translated into user's language while updating any document with tracked fields (opw 612847)
2014-09-05 13:53:25 +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
Anael Closson 0bee015dd6 [FIX] mail: more robust parsing of In-Reply-To/References (OPW 608919)
When parsing incoming messages, ignore white-space around
In-Reply-To headers, and extract message-id items inside
the References header using a regex.
This actually serves as a workaround for broken MTAs
mangling References (such as outlook.com nesting past ones
with commas, violating RFC2822).

Closes #516 as a manual rebase.
2014-09-01 13:51:08 +02:00
Anaël Closson f247bdd0b6 [FIX] mail: message-id not parsed properly in message_route
Same as for rev 4bad513, the references were not correctly parsed, added missing regex
2014-08-01 08:55:27 +02:00
Martin Trigaux b5918cb55c [MERGE] forward port of branch 7.0 up to 67cca3f 2014-07-23 16:23:22 +02:00
Sandy Carter 67cca3f1e5 [FIX] mail: display translated model name at record creation
When a record is created, if it inherits from mail.thread, a message 'OBJECT created' is posted. 'created' is translated but the name of the model wasn't.
This fix uses the name of the linked ir.model which is already a translatable field.
lp:1262000, opw 611043
2014-07-23 15:35:41 +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
Anael Closson 4bad513d29 [FIX] mail: more robust parsing of In-Reply-To/References (OPW 608919)
When parsing incoming messages, ignore white-space around
In-Reply-To headers, and extract message-id items inside
the References header using a regex.
This actually serves as a workaround for broken MTAs
mangling References (such as outlook.com nesting past ones
with commas, violating RFC2822).

Closes #516 as a manual rebase.
2014-06-18 14:39:37 +02:00
Christophe Simonis 7dd69540e8 [MERGE] forward port of branch 7.0 up to 0c4bc1c 2014-06-03 19:11:44 +02:00
Jean-Baptiste Quenot 310ecb0d60 Fix detection of MIME type in message_parse()
Be careful, content-type may contain tricky content like in the
following example so test the MIME type with startswith()

Content-Type: multipart/related;
  boundary="_004_3f1e4da175f349248b8d43cdeb9866f1AMSPR06MB343eurprd06pro_";
  type="text/html"
2014-06-02 11:48:30 +02:00
Christophe Simonis 1953aa442f [MERGE] forward port of branch 7.0 up to revid 10037 mat@openerp.com-20140507133552-v4qsdp7qdp9iwewi
bzr revid: chs@openerp.com-20140507153348-g2qw61dkxvps13br
2014-05-07 17:33:48 +02:00
Jacques-Etienne Baudoux a918e89995 [FIX] mail: change copy call to copy_data to avoid resending email during duplication (opw 607295)
bzr revid: mat@openerp.com-20140505094329-vr7h4c92i43ezob4
2014-05-05 11:43:29 +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 4ed8413dc7 [FIX] mail.thread: avoid wrongly matching model,id from a foreign OpenERP system
When emails transit from an OpenERP system to another
there is a chance of wrongly considering the foreign
model,id pair as local, possibly attaching a reply
to a wrong parent message.
This naive heuristic ignore the foreign identifiers
unless the hostname of the message-id mentioned in
the In-Reply-To header matches the local one.
This may fail after a change of local hostname but
is still better than the alternative.
In OpenERP v8 we should stop including the model,res_id
in outgoing Message-Id headers and only rely on the
stored, opaque, unique Message-Ids, preventing
any future mismatch.

bzr revid: odo@openerp.com-20140411101349-h3jmkdzvbr7lut26
2014-04-11 12:13:49 +02:00
Christophe Simonis b3bb47076b [MERGE] forward port of branch saas-2 up to revid 9151 chs@openerp.com-20140314104803-19c5snl2fcuih91o
bzr revid: chs@openerp.com-20140314105753-7a7wh9a1z99azgfj
2014-03-14 11:57:53 +01:00
Denis Ledoux 02459f8d4a [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9929 revid:dle@openerp.com-20140325104921-x8zjx5p71l1o3uif
bzr revid: dle@openerp.com-20140310133913-465x5t3n1bo7fu98
bzr revid: dle@openerp.com-20140311164146-2s599kogbqj8e94l
bzr revid: dle@openerp.com-20140312111149-u6y036aej3ywq7et
bzr revid: dle@openerp.com-20140312121145-06s1jvct9v4m7l6s
bzr revid: mat@openerp.com-20140313084409-c0kckxemy3in0mlo
bzr revid: chs@openerp.com-20140313163420-ifa4hyixj722d6jo
bzr revid: chs@openerp.com-20140314102034-g0nzryvwhrpzdas9
bzr revid: chs@openerp.com-20140314104803-19c5snl2fcuih91o
bzr revid: odo@openerp.com-20140314143519-x6rzcfkkqxwc0e1g
bzr revid: chs@openerp.com-20140318110229-y8098w3shdpmoig2
bzr revid: dle@openerp.com-20140318151824-sscl4m8p87emjl8s
bzr revid: dle@openerp.com-20140320112618-yfyihlwz66ryeqf5
bzr revid: dle@openerp.com-20140320161003-j01cc6sqves2wnp2
bzr revid: dle@openerp.com-20140320181252-4gqcog22p1ex0pz7
bzr revid: dle@openerp.com-20140321140450-8ulnhr76qybiadks
bzr revid: dle@openerp.com-20140324104743-ubvu8st7emq9pg1q
bzr revid: dle@openerp.com-20140325112413-xs5z7y81rhyjt0rd
2014-03-25 12:24:13 +01:00
Olivier Dony 9e002d9233 [FIX] mail.thread: avoid error if `message_unread_count` has been popped 1 line earlier
bzr revid: odo@openerp.com-20140314104605-qi7eqj2g37dvxvc3
2014-03-14 11:46:05 +01:00
Christophe Simonis 44a99c0976 [FIX] calendar: correct recurrency end date computation
bzr revid: chs@openerp.com-20140314094809-0wuus62tob8vtyi0
2014-03-14 10:48:09 +01:00
Thibault Delavallée 700bbfcce1 [FIX] mail_thread: when reading subscription data, add a protection
against not planned subtype data (coming from error in subtype relationship
table, or for undisplayed subtypes, old subtypes, ...).

bzr revid: tde@openerp.com-20140225090637-mnztroc05nk7l2sl
2014-02-25 10:06:37 +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
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
Thibault Delavallée ec5291c130 [IMP] fetchmail: try / except the processinf of each email and log any exception
found during processing. This way, all emails in the queue are managed and
all failed emails have their own exception in the logs, allowing easier
debugging.
Note that a failed email is set as seen to avoid processing it every time
the scheduler runs.

bzr revid: tde@openerp.com-20140213095717-tcwgkl143i3ujw8h
2014-02-13 10:57:17 +01:00
Thibault Delavallée dca7f71d71 [DOC] mail_thread: docstrings to add raised exceptions in message_process and message_route
bzr revid: tde@openerp.com-20140213090122-0gwin1pjigwu42sz
2014-02-13 10:01:22 +01:00
Olivier Dony bbd813e76e [MERGE] Forward-port of latest saas-2 (incl. 7.0) bugfixes, up to rev. 9127 odo@openerp.com-20140212122042-3m2tysmr31mtecnc
bzr revid: odo@openerp.com-20140212175141-i9yz8zlseglrk8sb
2014-02-12 18:51:41 +01:00
Thibault Delavallée 150d5a9e18 [IMP] mail: mail_thread: message routing: raise exceptions instead of using asserts.
Indeed assert are statements meant to be used when developping, for
debug purpose. In a production environment it is safer to use real
exceptions that can be managed accordingly.

bzr revid: tde@openerp.com-20140212152737-c7q339psd9hi4iwd
2014-02-12 16:27:37 +01:00
Denis Ledoux 0043f81e33 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9824 revid:dle@openerp.com-20140210134603-ck0jr56xhl8xgzg2
bzr revid: dle@openerp.com-20140210141704-sjzjwhe7fh5gszxr
2014-02-10 15:17:04 +01:00
Thibault Delavallée 759ed5bbb6 [IMP] mail: subscription: if no-one to (un)subscribe, already return. This is not
necessary for computation, but saves some browse / access right checking.

bzr revid: tde@openerp.com-20140210115827-2y451i0edgve59mi
2014-02-10 12:58:27 +01:00
Martin Trigaux 54a1ffc480 [FIX] mail: priority -10 on message_follower_ids to make sure executed before other function field that may use the followers (eg: note.note for access rights)
bzr revid: mat@openerp.com-20140210083130-ag95lqwlpkv7ceqc
2014-02-10 09:31:30 +01:00
Olivier Dony f7c1afffcb [FIX] mail.thread: avoid tracking multiple temporary changes during copy
bzr revid: odo@openerp.com-20140206173251-1njroiu08fzgdbyp
2014-02-06 18:32:51 +01:00
Denis Ledoux 15c105d95f [FIX] mail: re-apply security fix correctly from 9812 revid:mat@openerp.com-20140206121438-epghqo042ync24v5 of 7.0 branch
bzr revid: dle@openerp.com-20140206170829-918bxb88qh415w9e
2014-02-06 18:08:29 +01:00
Denis Ledoux 8e4279835b [FIX]mail: fix indentation problem from previous forward port
bzr revid: dle@openerp.com-20140206165630-13w44y6iewdrsl02
2014-02-06 17:56:30 +01:00