root/alternc-mailman/trunk/patches/mailman-true-virtual-2.1.4.patch
| Revision 2208, 5.1 kB (checked in by anarcat, 5 months ago) |
|---|
-
./bin/newlist
old new 133 133 host_name = None 134 134 web_page_url = None 135 135 if '@' in listname: 136 listname, domain = listname.split('@', 1)136 firstname, domain = listname.split('@', 1) 137 137 host_name = mm_cfg.VIRTUAL_HOSTS.get(domain, domain) 138 138 web_page_url = mm_cfg.DEFAULT_URL_PATTERN % domain 139 -- Mailman/Gui/General.py.orig Wed Mar 16 15:46:552005139 ++ Mailman/Gui/General.py Wed Mar 16 15:47:21 2005 … … 413 413 414 414 def _setValue(self, mlist, property, val, doc): 415 415 if property == 'real_name' and \ 416 val.lower() <> mlist. internal_name().lower():416 val.lower() <> mlist.real_name.lower(): 417 417 # These values can't differ by other than case 418 418 doc.addError(_("""<b>real_name</b> attribute not 419 419 changed! It must differ from the list's name by case -
Mailman/MailList.py
old new 183 183 return self._full_path 184 184 185 185 def getListAddress(self, extra=None): 186 posting_addr = self.internal_name() 187 try: 188 posting_addr = self.real_name.lower() 189 except: 190 pass 186 191 if extra is None: 187 return '%s@%s' % ( self.internal_name(), self.host_name)188 return '%s-%s@%s' % ( self.internal_name(), extra, self.host_name)192 return '%s@%s' % (posting_addr, self.host_name) 193 return '%s-%s@%s' % (posting_addr, extra, self.host_name) 189 194 190 195 # For backwards compatibility 191 196 def GetBouncesEmail(self): … … 434 439 # 435 440 def Create(self, name, admin, crypted_password, 436 441 langs=None, emailhost=None): 437 if Utils.list_exists(name):438 raise Errors.MMListAlreadyExistsError, name439 442 # Validate what will be the list's posting address. If that's 440 443 # invalid, we don't want to create the mailing list. The hostname 441 444 # part doesn't really matter, since that better already be valid. 442 445 # However, most scripts already catch MMBadEmailError as exceptions on 443 446 # the admin's email address, so transform the exception. 444 if emailhost is None: 445 emailhost = mm_cfg.DEFAULT_EMAIL_HOST 446 postingaddr = '%s@%s' % (name, emailhost) 447 if emailhost is None: 448 emailhost = mm_cfg.DEFAULT_EMAIL_HOST 449 # default, for when no domain is given 450 firstname = name 451 # we set a special name for virtual hosted lists 452 if '@' in name: 453 firstname, emailhost = name.split('@', 1) 454 name = "%s-%s" % (firstname, emailhost) 455 # but we keep a sensible posting address 456 postingaddr = '%s@%s' % (firstname, emailhost) 447 457 try: 448 458 Utils.ValidateEmail(postingaddr) 449 459 except Errors.MMBadEmailError: 450 460 raise Errors.BadListNameError, postingaddr 451 461 # Validate the admin's email address 452 462 Utils.ValidateEmail(admin) 463 if Utils.list_exists(name): 464 raise Errors.MMListAlreadyExistsError, name 453 465 self._internal_name = name 454 466 self._full_path = Site.get_listpath(name, create=1) 455 467 # Don't use Lock() since that tries to load the non-existant config.pck 456 468 self.__lock.lock() 457 469 self.InitVars(name, admin, crypted_password) 458 470 self.CheckValues() 471 # this is for getListAddress 472 self.list_address = postingaddr 473 self.real_name = firstname 474 self.subject_prefix = mm_cfg.DEFAULT_SUBJECT_PREFIX % self.__dict__ 459 475 if langs is None: 460 476 self.available_languages = [self.preferred_language] 461 477 else: … … 1243 1260 to or cc addrs.""" 1244 1261 # BAW: fall back to Utils.ParseAddr if the first test fails. 1245 1262 # this is the list's full address 1246 listfullname = '%s@%s' % (self.internal_name(), self.host_name)1263 listfullname = self.getListAddress() 1247 1264 recips = [] 1248 1265 # check all recipient addresses against the list's explicit addresses, 1249 1266 # specifically To: Cc: and Resent-to: … … 1295 1308 addr = addr.lower() 1296 1309 localpart = addr.split('@')[0] 1297 1310 if (# TBD: backwards compatibility: deprecated 1298 localpart == self. internal_name() or1311 localpart == self.real_name.lower() or 1299 1312 # exact match against the complete list address 1300 1313 addr == listfullname): 1301 1314 return 1
Note: See TracBrowser for help on using the browser.
