[Mailman-Users] private lists with real name signatures

Mark Sapiro mark at msapiro.net
Wed May 26 17:14:39 CEST 2010


Doug Gaff wrote:
>
>The request I'm getting from list members is to have their "Real Name"
>displayed but not their email address. I see two ways to do this:
>
> 
>
>1.       The "on behalf of" text in the header could put the real name only
>and not the email address.


The "on behalf of" text is just MS Outlook's (and some other MUAs lik
Hotmail) way of displaying the From: header when there is a Sender:
header. In any case, Mailman's way of handling the From: in an
anonymous list is to make it "List description
<list_posting_address>". Replacing the list description with the
poster's name would require modifying the code in
Mailman/Handlers/Cleanse.py.


>2.       An auto signature can be appended to the end of each sent message.


Here you could create a custom handler (see the FAQ at
<http://wiki.list.org/x/l4A9>). If the message's metadata contains a
dictionary named decoration-data, that dictionary is used to update
the replacements available for msg_header and msg_footer. Thus if the
custom handler were in the pipeline prior to Cleanse, i.e. prior to
the replacement of the From: header, it could be something like:

from email.Utils import parseaddr
def process(mlist, msg, msgdata):
    poster_name = parseaddr(msg['from'])[0]
    if 'decoration-data' in msgdata:
        msgdata['decoration-data']['poster_name'] = poster_name
    else:
        msgdata['decoration-data'] = {'poster_name': poster_name}

This would add %(poster_name)s to the replacements available for
msg_header and msg_footer, and its value would be the real name part
of the From: address of the original post or the empty string if there
wasn't a real name in the From:

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list