[Mailman-Users] emailaddr variable in newlist.txt file

Mark Sapiro msapiro at value.net
Thu Feb 23 05:09:04 CET 2006


Christopher Adams wrote:

>I have been tinkering with this problem for a long time. At one time, I 
>got some assistance from Mark Sapiro, but I was not able to resolve the 
>problem.


I would have thought we'd got this all resolved in the thread that
begins at
<http://mail.python.org/pipermail/mailman-users/2005-January/042107.html>,
but I guess not.


>The newlist.txt file has the variable %(emailaddr)s. When a new list is 
>created, the message that is sent to the list owner includes the literal 
>text %(emailaddr)s, rather than the actual list address.


This is because the only names of this type that are replaced in this
template are the ones in the default template. Namely,

listname
password
admin_url
listinfo_url
requestaddr and
siteowner

>I would have thought that this would work by default after installation, 
>but it does not.

If you want %(emailaddr)s in the template to be replaced by the list
posting address, you need to modify Mailman/Cgi/Create.py as follows:

Find this in the module

    # And send the notice to the list owner.
    if notify:
        siteowner = Utils.get_site_email(mlist.host_name, 'owner')
        text = Utils.maketext(
            'newlist.txt',
            {'listname'    : listname,
             'password'    : password,
             'admin_url'   : mlist.GetScriptURL('admin', absolute=1),
             'listinfo_url': mlist.GetScriptURL('listinfo', absolute=1),
             'requestaddr' : mlist.GetRequestEmail(),
             'siteowner'   : siteowner,
             }, mlist=mlist)

and add one line to it so it becomes

    # And send the notice to the list owner.
    if notify:
        siteowner = Utils.get_site_email(mlist.host_name, 'owner')
        text = Utils.maketext(
            'newlist.txt',
            {'listname'    : listname,
             'password'    : password,
             'admin_url'   : mlist.GetScriptURL('admin', absolute=1),
             'listinfo_url': mlist.GetScriptURL('listinfo', absolute=1),
             'requestaddr' : mlist.GetRequestEmail(),
             'emailaddr'   : mlist.GetListEmail(),
             'siteowner'   : siteowner,
             }, mlist=mlist)

-- 
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