From 638de3201ed3e29ed2eeb3932a22e3bd9d145a24 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Fri, 7 Feb 2014 18:11:30 +0100 Subject: [PATCH] fix email address regexp --- weboob/applications/boobtracker/boobtracker.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weboob/applications/boobtracker/boobtracker.py b/weboob/applications/boobtracker/boobtracker.py index 9511d432..e5dbe982 100644 --- a/weboob/applications/boobtracker/boobtracker.py +++ b/weboob/applications/boobtracker/boobtracker.py @@ -347,9 +347,9 @@ class BoobTracker(ReplApplication): issue.body = content - emails = re.findall('<(.*@.*)>', m['From'] or '') - if len(emails) > 0: - return emails[0] + m = re.search('([^< ]+@[^ >]+)', m['From'] or '') + if m: + return m.group(1) def edit_issue(self, issue, edit=True): backend = self.weboob.get_backend(issue.backend) @@ -398,7 +398,7 @@ Regards, Weboob Team """ % (issue.title, issue.id) - msg = MIMEText(text) + msg = MIMEText(text, 'plain', 'utf-8') msg['Subject'] = 'Issue #%s reported' % issue.id msg['From'] = 'Weboob ' msg['To'] = email_to