[Mailman-Users] from field with real name

Mark Sapiro msapiro at value.net
Fri Feb 18 08:24:20 CET 2005


Stefan Hofmeir wrote:
>
>Am Montag, 7. Februar 2005 um 02:48 schrieb Mark Sapiro:
>>>How it is possible to sent also a real name like
>>>From: "list ABC <mailman at testdomain.de>" in every newsletter?
>
>> You have to hack Mailman/Handlers/Cleanse.py to do this.
>thanks!
>
>Original code:
>msg['From'] = mlist.GetListEmail()
>
>I tried
>msg['From'] = mlist.real_name() % ' <' % mlist.GetListEmail() % '>'
>msg['From'] = mlist.real_name() + ' <' + mlist.GetListEmail() + '>'
>msg['From'] = mlist.real_name() . ' <' . mlist.GetListEmail() . '>'
>but it doesn´t work.
>
>What is the right syntax?

The second form is good, but real_name is an attribute, not a method so
you say

 msg['From'] = mlist.real_name + ' <' + mlist.GetListEmail() + '>'

(and be sure to preserve indentation)

Note that Tokio replied

>It sounded like a reasonablly small and nice hack request so I inserted 
>a few steps of code in Cleanse.py. I used internal_name instead of 
>real_name though. It was checked in CVS and will be in 2.1.6 soon.

So it might be better to do it the same way. You can see Tokio's change
in patch form at
http://cvs.sourceforge.net/viewcvs.py/mailman/mailman/Mailman/Handlers/Cleanse.py?r1=text&tr1=2.5.2.1&r2=text&tr2=2.5.2.2&diff_format=u

--
Mark Sapiro <msapiro at value.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