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 470-477 Link Here
470
    #
475
    #
471
    def Create(self, name, admin, crypted_password,
476
    def Create(self, name, admin, crypted_password,
472
               langs=None, emailhost=None):
477
               langs=None, emailhost=None):
473
        if Utils.list_exists(name):
474
            raise Errors.MMListAlreadyExistsError, name
475
        # Validate what will be the list's posting address.  If that's
478
        # Validate what will be the list's posting address.  If that's
476
        # invalid, we don't want to create the mailing list.  The hostname
479
        # invalid, we don't want to create the mailing list.  The hostname
477
        # part doesn't really matter, since that better already be valid.
480
        # part doesn't really matter, since that better already be valid.
Lines 479-489 Link Here
479
        # the admin's email address, so transform the exception.
482
        # the admin's email address, so transform the exception.
480
        if emailhost is None:
483
        if emailhost is None:
481
            emailhost = mm_cfg.DEFAULT_EMAIL_HOST
484
            emailhost = mm_cfg.DEFAULT_EMAIL_HOST
482
        postingaddr = '%s@%s' % (name, emailhost)
485
        firstname = name
486
        if '@' in name:
487
            firstname, emailhost = name.split('@', 1)
488
        # Keep posting address sane.
489
        postingaddr = '%s@%s' % (firstname, emailhost)
490
        name = '%s-%s' % (firstname, emailhost)
483
        try:
491
        try:
484
            Utils.ValidateEmail(postingaddr)
492
            Utils.ValidateEmail(postingaddr)
485
        except Errors.MMBadEmailError:
493
        except Errors.MMBadEmailError:
486
            raise Errors.BadListNameError, postingaddr
494
            raise Errors.BadListNameError, postingaddr
495
        # Refuse to create lists that already exists
496
        if Utils.list_exists(name):
497
            raise Errors.MMListAlreadyExistsError, name
487
        # Validate the admin's email address
498
        # Validate the admin's email address
488
        Utils.ValidateEmail(admin)
499
        Utils.ValidateEmail(admin)
489
        self._internal_name = name
500
        self._internal_name = name
Lines 491-496 Link Here
491
        # Don't use Lock() since that tries to load the non-existant config.pck
502
        # Don't use Lock() since that tries to load the non-existant config.pck
492
        self.__lock.lock()
503
        self.__lock.lock()
493
        self.InitVars(name, admin, crypted_password)
504
        self.InitVars(name, admin, crypted_password)
505
        # This is for getListAddress
506
        self.list_address = postingaddr
507
        self.real_name = firstname
508
        self.subject_prefix = mm_cfg.DEFAULT_SUBJECT_PREFIX % self.__dict__
494
        self.CheckValues()
509
        self.CheckValues()
495
        if langs is None:
510
        if langs is None:
496
            self.available_languages = [self.preferred_language]
511
            self.available_languages = [self.preferred_language]
Lines 1322-1328 Link Here
1322
        addresses in the recipient headers.
1337
        addresses in the recipient headers.
1323
        """
1338
        """
1324
        # This is the list's full address.
1339
        # This is the list's full address.
1325
        listfullname = '%s@%s' % (self.internal_name(), self.host_name)
1340
        listfullname = self.getListAddress()
1326
        recips = []
1341
        recips = []
1327
        # Check all recipient addresses against the list's explicit addresses,
1342
        # Check all recipient addresses against the list's explicit addresses,
1328
        # specifically To: Cc: and Resent-to:
1343
        # 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/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 ! '@' 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 193-199 Link Here
193
        oldmask = os.umask(002)
193
        oldmask = os.umask(002)
194
        try:
194
        try:
195
            try:
195
            try:
196
                mlist.Create(listname, owner_mail, pw)
196
                mlist.Create(listname, owner_mail, pw, emailhost=emailhost)
197
            finally:
197
            finally:
198
                os.umask(oldmask)
198
                os.umask(oldmask)
199
        except Errors.BadListNameError, s:
199
        except Errors.BadListNameError, s:

Return to bug 208789