[Mailman-Users] customising: from listname-bounce at domain on behalfof poster at theirdomain

Mark Sapiro msapiro at value.net
Thu Jul 20 19:52:00 CEST 2006


John Clement wrote:

>I've setup mailman with qmail, using lists.domain.com so it works, then 
>setup aliases for lists so we can still have ourlist at domain.com rather than 
>ourlist at lists.domain.com, I've also added this to mailman's config so itss 
>happy accepting posts to domain.com.
>
>The only problem I have now is when a member receives a post they receive it 
>as
>
>[listname] listname at domain.com list posting.
>listname-bounce at lists.domain.com on behalf of (orig poster)
>
>I'd like to change listname-bounce at lists.domain.com to 
>listname-admin at domain.com
>
>I can find info on customising pretty much everything else but this! Any 
>suggestions?


There are two different things going on here. For information on the
'on behalf of' as displayed by MS Outlook, see
<http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq02.003.htp>

Changing any of this may require modification of the code in
Mailman/Handlers/SMTPDirect.com. You can change -bounce to -admin by
changing

    if envsender is None:
        if mlist:
            envsender = mlist.GetBouncesEmail()
        else:
            envsender = Utils.get_site_email(extra='bounces')

in SMTPDirect.py to

    if envsender is None:
        if mlist:
            envsender = mlist.getListAddress('admin')
        else:
            envsender = Utils.get_site_email(extra='admin')

Bounce processing will still work OK since -admin is a (deprecated)
synonym for -bounces.

To fix the domain, If I understand your configuration correctly, you
can put (I'm changing domain to example per RFCs)

DEFAULT_URL_HOST = 'lists.example.com'
DEFAULT_EMAIL_HOST = 'example.com'
VIRTUAL_HOSTS.clear()
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)

in mm_cfg.py and do 'bin/mailmanctl restart'

Then you need to update the lists with

bin/withlist -l -a -r fix_url

or in this case, if only DEFAULT_EMAIL_HOST changed, you can skip
fix_url and change the host_name attribute on the admin General
Options page.

See
<http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq04.069.htp>
and
<http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq04.029.htp>


You can also get rid of the 'on behalf of' all together by looking at
the lines

    del msg['sender']
    del msg['errors-to']
    msg['Sender'] = envsender
    msg['Errors-To'] = envsender

in the bulkdeliver() function in SMTPDirect.py.

To have outlook just say From: original poster, delete or comment

    msg['Sender'] = envsender

To have outlook say From: original sender (if any) on behalf of
original poster, also delete the line

    del msg['sender']

leaving onle the two 'errors-to' lines.

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