diff --git a/addons/mass_mailing/models/mail_mail.py b/addons/mass_mailing/models/mail_mail.py index 29837c02040..f4611a3250c 100644 --- a/addons/mass_mailing/models/mail_mail.py +++ b/addons/mass_mailing/models/mail_mail.py @@ -62,15 +62,14 @@ class MailMail(osv.Model): body = super(MailMail, self).send_get_mail_body(cr, uid, ids, partner=partner, context=context) mail = self.browse(cr, uid, ids[0], context=context) - links_blacklist = ['/unsubscribe_from_list'] - if mail.mailing_id and body and mail.statistics_ids: for match in re.findall(URL_REGEX, mail.body_html): - href = match[0] url = match[1] - if not [s for s in links_blacklist if s in href]: + parsed = urlparse.urlparse(url, scheme='http') + + if parsed.scheme.startswith('http') and parsed.path.startswith('/r/'): new_href = href.replace(url, url + '/m/' + str(mail.statistics_ids[0].id)) body = body.replace(href, new_href)