From d16f784d5a781ce4e5abbb39afba77515b1cb345 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Tue, 8 Apr 2014 09:28:26 -0700 Subject: For from_is_list feature, use email address from original From: if original From: has no display name and strip domain part from resultant names that look like email addresses. (LP: #1304511) --- Mailman/Handlers/CookHeaders.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Mailman') diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py index 1333e650..f0a2fc47 100755 --- a/Mailman/Handlers/CookHeaders.py +++ b/Mailman/Handlers/CookHeaders.py @@ -123,6 +123,8 @@ def process(mlist, msg, msgdata): realname, email = parseaddr(msg['from']) if not realname: realname = email + # Remove domain from realname if it looks like an email address + realname = re.sub(r'@([^ .]+\.)+[^ .]+$', '---', realname) replies = getaddresses(msg.get('reply-to', '')) reply_addrs = [x[1].lower() for x in replies] if reply_addrs: -- cgit v1.2.3