From d1e7ad9be6f01644567df0fb8d0e68e6c40aff5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 6 Aug 2013 17:10:18 +0200 Subject: [PATCH] [IMP] tools: added a regex for bounce email addresses bzr revid: tde@openerp.com-20130806151018-0uom07dbr8b7ycb3 --- openerp/tools/mail.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openerp/tools/mail.py b/openerp/tools/mail.py index 5970ce47040..36a4c1610c4 100644 --- a/openerp/tools/mail.py +++ b/openerp/tools/mail.py @@ -297,6 +297,11 @@ command_re = re.compile("^Set-([a-z]+) *: *(.+)$", re.I + re.UNICODE) # group(1) = the record ID ; group(2) = the model (if any) ; group(3) = the domain reference_re = re.compile("<.*-open(?:object|erp)-(\\d+)(?:-([\w.]+))?.*@(.*)>", re.UNICODE) +# Bounce regex +# Typical form of bounce is bounce-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("[\w]+-(\d+)-?([\w.]+)?-?(\d+)?", re.UNICODE) + def generate_tracking_message_id(res_id): """Returns a string that can be used in the Message-ID RFC822 header field