diff options
| author | Christophe Simonis <chs@odoo.com> | 2014-09-05 15:28:22 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2014-09-05 15:28:22 +0200 |
| commit | 31bf30d2d0eb78baaa36360b99fe58bf7cd4c9e7 (patch) | |
| tree | d7be61ecd6bb4c8b5552e39b03e2a64eebbbf323 /addons/mass_mailing/models/mail_thread.py | |
| parent | afba9e8817c458640ae446ac7aaaab79be4fe1e9 (diff) | |
| parent | ed1c173971968eaa96693cb4e1547efa6e6c34e0 (diff) | |
[MERGE] forward port of branch 8.0 up to ed1c173
Diffstat (limited to 'addons/mass_mailing/models/mail_thread.py')
| -rw-r--r-- | addons/mass_mailing/models/mail_thread.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/addons/mass_mailing/models/mail_thread.py b/addons/mass_mailing/models/mail_thread.py index 524341f88d7..7bfce705043 100644 --- a/addons/mass_mailing/models/mail_thread.py +++ b/addons/mass_mailing/models/mail_thread.py @@ -20,8 +20,8 @@ ############################################################################## import logging +import re -from openerp import tools from openerp.addons.mail.mail_message import decode from openerp.addons.mail.mail_thread import decode_header from openerp.osv import osv @@ -46,7 +46,11 @@ class MailThread(osv.AbstractModel): # 0. Verify whether this is a bounced email (wrong destination,...) -> use it to collect data, such as dead leads if bounce_alias in email_to: - bounce_match = tools.bounce_re.search(email_to) + # Bounce regex + # Typical form of bounce is bounce_alias-128-crm.lead-34@domain + # group(1) = the mail ID; group(2) = the model (if any); group(3) = the record ID + bounce_re = re.compile("%s-(\d+)-?([\w.]+)?-?(\d+)?" % re.escape(bounce_alias), re.UNICODE) + bounce_match = bounce_re.search(email_to) if bounce_match: bounced_model, bounced_thread_id = None, False bounced_mail_id = bounce_match.group(1) |
