Nuno Gonçalves wrote:
>
>I am looking a way in order to change the subject of the welcome message.
>In the file in [Mailman home directory/Mailman/Deliverer.py] (line 79) there
>is a line :
>_('Welcome to the "%(realname)s" mailing list%(digmode)s')
>
>
>Is there anyway of subtituting the variable realname for one in the
>acceptable aliases list (the firts one for instance)?
>Is there any variable acceptable_aliases (confs/list.conf) accessable in the
>Deliverer.py ?
You could do this in several ways. If you really want to do exactly
what you said, you could change
realname = self.real_name
msg = Message.UserNotification(
self.GetMemberAdminEmail(name), self.GetRequestEmail(),
_('Welcome to the "%(realname)s" mailing list%(digmode)s'),
text, pluser)
to
realname = self.acceptable_aliases[0]
msg = Message.UserNotification(
self.GetMemberAdminEmail(name), self.GetRequestEmail(),
_('Welcome to the "%(realname)s" mailing list%(digmode)s'),
text, pluser)
but then you have to guarantee that every list has at least one entry
in acceptable_aliases, because referencing self.acceptable_aliases[0]
will throw an IndexError exception if the acceptable_aliases list is
empty.
A more realistic approach would just be to use the normal list posting
address, not an alias. Then the code would be
realname = self.getListAddress()
msg = Message.UserNotification(
self.GetMemberAdminEmail(name), self.GetRequestEmail(),
_('Welcome to the "%(realname)s" mailing list%(digmode)s'),
text, pluser)
Note that both of the above change only the first line - the assignment
to realname.
If you really wanted to get fancy and use an alias iff there was one,
you could do
if self.acceptable_aliases:
realname = self.acceptable_aliases[0]
else:
realname = self.getListAddress()
msg = Message.UserNotification(
self.GetMemberAdminEmail(name), self.GetRequestEmail(),
_('Welcome to the "%(realname)s" mailing list%(digmode)s'),
text, pluser)
--
Mark Sapiro <[EMAIL PROTECTED]> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
------------------------------------------------------
Mailman-Users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe:
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org
Security Policy:
http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp