[PATCH 1/3] parsemail: Parse Mailman-formatted addresses

Stephen Finucane stephen.finucane at intel.com
Tue Dec 22 03:21:41 AEDT 2015


If loading archives from mailman, it is useful to parse and format
addresses such that they are proper emails.

Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
---
 patchwork/bin/parsemail.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/patchwork/bin/parsemail.py b/patchwork/bin/parsemail.py
index 43d733f..8870f62 100755
--- a/patchwork/bin/parsemail.py
+++ b/patchwork/bin/parsemail.py
@@ -127,6 +127,10 @@ def find_author(mail):
         # for example at 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]))),
     ]
-- 
2.0.0



More information about the Patchwork mailing list