From: Stephen Finucane Date: Wed, 16 Dec 2015 12:02:02 +0000 (+0000) Subject: parsemail: Parse Mailman-formatted addresses X-Git-Tag: v1.1.0~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b15c1045f6660f558fcc58da3fe581c3c0cdb5ed;p=thirdparty%2Fpatchwork.git parsemail: Parse Mailman-formatted addresses If loading archives from mailman, it is useful to parse and format addresses such that they are proper emails. Signed-off-by: Stephen Finucane --- diff --git a/patchwork/bin/parsemail.py b/patchwork/bin/parsemail.py index 43d733f3..8870f62a 100755 --- a/patchwork/bin/parsemail.py +++ b/patchwork/bin/parsemail.py @@ -127,6 +127,10 @@ def find_author(mail): # for example@example.com (Firstname Lastname) style addresses (re.compile(r'"?(.*?)"?\s*\(([^\)]+)\)'), (lambda g: (g[1], g[0]))), + # for example at example.com (Firstname Lastname) style addresses + (re.compile(r'(.*?)\sat\s(.*?)\s*\(([^\)]+)\)'), + (lambda g: (g[2], '@'.join(g[0:2])))), + # everything else (re.compile(r'(.*)'), (lambda g: (None, g[0]))), ]