aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2014-04-08 19:15:59 -0700
committerMark Sapiro <mark@msapiro.net>2014-04-08 19:15:59 -0700
commit192caa4943eb87e466229736eccefd4381042fd7 (patch)
tree9186857629a214929136bd9a05017d5c9645b172 /Mailman
parentd16f784d5a781ce4e5abbb39afba77515b1cb345 (diff)
downloadmailman2-192caa4943eb87e466229736eccefd4381042fd7.tar.gz
mailman2-192caa4943eb87e466229736eccefd4381042fd7.tar.xz
mailman2-192caa4943eb87e466229736eccefd4381042fd7.zip
Enhanced fix for LP: #1304511 to use member's real name if available.
Diffstat (limited to 'Mailman')
-rwxr-xr-xMailman/Handlers/CookHeaders.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py
index f0a2fc47..110302ea 100755
--- a/Mailman/Handlers/CookHeaders.py
+++ b/Mailman/Handlers/CookHeaders.py
@@ -122,7 +122,10 @@ def process(mlist, msg, msgdata):
if mm_cfg.ALLOW_FROM_IS_LIST and mlist.from_is_list and not fasttrack:
realname, email = parseaddr(msg['from'])
if not realname:
- realname = email
+ if mlist.isMember(email):
+ realname = mlist.getMemberName(email) or email
+ else:
+ realname = email
# Remove domain from realname if it looks like an email address
realname = re.sub(r'@([^ .]+\.)+[^ .]+$', '---', realname)
replies = getaddresses(msg.get('reply-to', ''))