Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 208789 | Differences between
and this patch

Collapse All | Expand All

(-)mailman-2.1.9-orig/Mailman/Gui/General.py (-1 / +1 lines)
Lines 420-426 Link Here
420
420
421
    def _setValue(self, mlist, property, val, doc):
421
    def _setValue(self, mlist, property, val, doc):
422
        if property == 'real_name' and \
422
        if property == 'real_name' and \
423
               val.lower() <> mlist.internal_name().lower():
423
               val.lower() <> mlist.real_name.lower():
424
            # These values can't differ by other than case
424
            # These values can't differ by other than case
425
            doc.addError(_("""<b>real_name</b> attribute not
425
            doc.addError(_("""<b>real_name</b> attribute not
426
            changed!  It must differ from the list's name by case
426
            changed!  It must differ from the list's name by case
(-)mailman-2.1.9-orig/Mailman/MailList.py (-6 / +21 lines)
Lines 185-193 Link Here
185
        return self._full_path
185
        return self._full_path
186
186
187
    def getListAddress(self, extra=None):
187
    def getListAddress(self, extra=None):
188
        posting_addr = self.internal_name()
189
        try:
190
            posting_addr = self.real_name
191
        except:
192
            pass
188
        if extra is None:
193
        if extra is None:
189
            return '%s@%s' % (self.internal_name(), self.host_name)
194
            return '%s@%s' % (posting_addr, self.host_name)
190
        return '%s-%s@%s' % (self.internal_name(), extra, self.host_name)
195
        return '%s-%s@%s' % (posting_addr, extra, self.host_name)
191
196
192
    # For backwards compatibility
197
    # For backwards compatibility
193
    def GetBouncesEmail(self):
198
    def GetBouncesEmail(self):
Lines 473-480 Link Here
473
    def Create(self, name, admin, crypted_password,
478
    def Create(self, name, admin, crypted_password,
474
               langs=None, emailhost=None):
479
               langs=None, emailhost=None):
475
        assert name == name.lower(), 'List name must be all lower case.'
480
        assert name == name.lower(), 'List name must be all lower case.'
476
        if Utils.list_exists(name):
477
            raise Errors.MMListAlreadyExistsError, name
478
        # Validate what will be the list's posting address.  If that's
481
        # Validate what will be the list's posting address.  If that's
479
        # invalid, we don't want to create the mailing list.  The hostname
482
        # invalid, we don't want to create the mailing list.  The hostname
480
        # part doesn't really matter, since that better already be valid.
483
        # part doesn't really matter, since that better already be valid.
Lines 482-492 Link Here
482
        # the admin's email address, so transform the exception.
485
        # the admin's email address, so transform the exception.
483
        if emailhost is None:
486
        if emailhost is None:
484
            emailhost = mm_cfg.DEFAULT_EMAIL_HOST
487
            emailhost = mm_cfg.DEFAULT_EMAIL_HOST
485
        postingaddr = '%s@%s' % (name, emailhost)
488
        firstname = name
489
        if '@' in name:
490
            firstname, emailhost = name.split('@', 1)
491
        # Keep posting address sane.
492
        postingaddr = '%s@%s' % (firstname, emailhost)
493
        name = '%s-%s' % (firstname, emailhost)
486
        try:
494
        try:
487
            Utils.ValidateEmail(postingaddr)
495
            Utils.ValidateEmail(postingaddr)
488
        except Errors.MMBadEmailError:
496
        except Errors.MMBadEmailError:
489
            raise Errors.BadListNameError, postingaddr
497
            raise Errors.BadListNameError, postingaddr
498
        # Refuse to create lists that already exists
499
        if Utils.list_exists(name):
500
            raise Errors.MMListAlreadyExistsError, name
490
        # Validate the admin's email address
501
        # Validate the admin's email address
491
        Utils.ValidateEmail(admin)
502
        Utils.ValidateEmail(admin)
492
        self._internal_name = name
503
        self._internal_name = name
Lines 494-499 Link Here
494
        # Don't use Lock() since that tries to load the non-existant config.pck
505
        # Don't use Lock() since that tries to load the non-existant config.pck
495
        self.__lock.lock()
506
        self.__lock.lock()
496
        self.InitVars(name, admin, crypted_password)
507
        self.InitVars(name, admin, crypted_password)
508
        # This is for getListAddress
509
        self.list_address = postingaddr
510
        self.real_name = firstname
511
        self.subject_prefix = mm_cfg.DEFAULT_SUBJECT_PREFIX % self.__dict__
497
        self.CheckValues()
512
        self.CheckValues()
498
        if langs is None:
513
        if langs is None:
499
            self.available_languages = [self.preferred_language]
514
            self.available_languages = [self.preferred_language]
Lines 1335-1341 Link Here
1335
        addresses in the recipient headers.
1350
        addresses in the recipient headers.
1336
        """
1351
        """
1337
        # This is the list's full address.
1352
        # This is the list's full address.
1338
        listfullname = '%s@%s' % (self.internal_name(), self.host_name)
1353
        listfullname = self.getListAddress()
1339
        recips = []
1354
        recips = []
1340
        # Check all recipient addresses against the list's explicit addresses,
1355
        # Check all recipient addresses against the list's explicit addresses,
1341
        # specifically To: Cc: and Resent-to:
1356
        # specifically To: Cc: and Resent-to:
(-)mailman-2.1.9-orig/Mailman/Utils.py (-1 / +1 lines)
Lines 215-221 Link Here
215
    # This means local, unqualified addresses, are no allowed
215
    # This means local, unqualified addresses, are no allowed
216
    if not domain_parts:
216
    if not domain_parts:
217
        raise Errors.MMBadEmailError, s
217
        raise Errors.MMBadEmailError, s
218
    if len(domain_parts) < 2:
218
    if len(domain_parts) < 2 and domain_parts[0] != 'localhost':
219
        raise Errors.MMBadEmailError, s
219
        raise Errors.MMBadEmailError, s
220
220
221
221
(-)mailman-2.1.9-orig/bin/list_lists (-3 / +3 lines)
Lines 1-4 Link Here
1
#! @PYTHON@
1
#! /usr/bin/python
2
#
2
#
3
# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
3
# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
4
#
4
#
Lines 99-105 Link Here
99
               mlist.web_page_url.find(vhost) == -1:
99
               mlist.web_page_url.find(vhost) == -1:
100
            continue
100
            continue
101
        mlists.append(mlist)
101
        mlists.append(mlist)
102
        longest = max(len(mlist.real_name), longest)
102
        longest = max(len(mlist.internal_name()), longest)
103
103
104
    if not mlists and not bare:
104
    if not mlists and not bare:
105
        print _('No matching mailing lists found')
105
        print _('No matching mailing lists found')
Lines 114-120 Link Here
114
            print mlist.internal_name()
114
            print mlist.internal_name()
115
        else:
115
        else:
116
            description = mlist.description or _('[no description available]')
116
            description = mlist.description or _('[no description available]')
117
            print '   ', format % (mlist.real_name, description)
117
            print '   ', format % (mlist.internal_name(), description)
118
118
119
119
120
120
(-)mailman-2.1.9-orig/bin/mailmanctl (+2 lines)
Lines 273-278 Link Here
273
273
274
def check_for_site_list():
274
def check_for_site_list():
275
    sitelistname = mm_cfg.MAILMAN_SITE_LIST
275
    sitelistname = mm_cfg.MAILMAN_SITE_LIST
276
    if not '@' in sitelistname:
277
        sitelistname = '%s-%s' % (sitelistname, mm_cfg.DEFAULT_EMAIL_HOST)
276
    try:
278
    try:
277
        sitelist = MailList(sitelistname, lock=0)
279
        sitelist = MailList(sitelistname, lock=0)
278
    except Errors.MMUnknownListError:
280
    except Errors.MMUnknownListError:
(-)mailman-2.1.9-orig/bin/newlist (-2 / +2 lines)
Lines 157-163 Link Here
157
157
158
    if '@' in listname:
158
    if '@' in listname:
159
        # note that --urlhost and --emailhost have precedence
159
        # note that --urlhost and --emailhost have precedence
160
        listname, domain = listname.split('@', 1)
160
        firstname, domain = listname.split('@', 1)
161
        urlhost = urlhost or domain
161
        urlhost = urlhost or domain
162
        emailhost = emailhost or mm_cfg.VIRTUAL_HOSTS.get(domain, domain)
162
        emailhost = emailhost or mm_cfg.VIRTUAL_HOSTS.get(domain, domain)
163
163
Lines 197-203 Link Here
197
                    langs = [lang]
197
                    langs = [lang]
198
                else:
198
                else:
199
                    langs = [lang, mm_cfg.DEFAULT_SERVER_LANGUAGE]
199
                    langs = [lang, mm_cfg.DEFAULT_SERVER_LANGUAGE]
200
                mlist.Create(listname, owner_mail, pw, langs=langs)
200
                mlist.Create(listname, owner_mail, pw, langs=langs, emailhost=emailhost)
201
            finally:
201
            finally:
202
                os.umask(oldmask)
202
                os.umask(oldmask)
203
        except Errors.BadListNameError, s:
203
        except Errors.BadListNameError, s:

Return to bug 208789