root/alternc-mailman/trunk/patches/mailman-true-virtual-2.1.9.patch
| Revision 2230, 5.6 kB (checked in by anarcat, 5 months ago) |
|---|
-
mailman/bin/newlist
old new 164 164 165 165 if '@' in listname: 166 166 # note that --urlhost and --emailhost have precedence 167 listname, domain = listname.split('@', 1)167 firstname, domain = listname.split('@', 1) 168 168 urlhost = urlhost or domain 169 169 emailhost = emailhost or mm_cfg.VIRTUAL_HOSTS.get(domain, domain) 170 170 -
mailman/Mailman/Gui/General.py
old new 420 420 421 421 def _setValue(self, mlist, property, val, doc): 422 422 if property == 'real_name' and \ 423 val.lower() <> mlist. internal_name().lower():423 val.lower() <> mlist.real_name.lower(): 424 424 # These values can't differ by other than case 425 425 doc.addError(_("""<b>real_name</b> attribute not 426 426 changed! It must differ from the list's name by case -
mailman/Mailman/Handlers/CookHeaders.py
old new 180 180 if msgdata.get('_nolist') or not mlist.include_rfc2369_headers: 181 181 return 182 182 # This will act like an email address for purposes of formataddr() 183 listid = '%s.%s' % (mlist.internal_name(), mlist.host_name) 183 #listid = '%s.%s' % (mlist.internal_name(), mlist.host_name) 184 # internal_name already contains the hostname with the vhost patch 185 listid = mlist.internal_name() 184 186 cset = Utils.GetCharSet(mlist.preferred_language) 185 187 if mlist.description: 186 188 # Don't wrap the header since here we just want to get it properly RFC -
mailman/Mailman/MailList.py
old new 185 185 return self._full_path 186 186 187 187 def getListAddress(self, extra=None): 188 posting_addr = self.internal_name() 189 try: 190 posting_addr = self.real_name.lower() 191 except: 192 pass 188 193 if extra is None: 189 return '%s@%s' % ( self.internal_name(), self.host_name)190 return '%s-%s@%s' % ( self.internal_name(), extra, self.host_name)194 return '%s@%s' % (posting_addr, self.host_name) 195 return '%s-%s@%s' % (posting_addr, extra, self.host_name) 191 196 192 197 # For backwards compatibility 193 198 def GetBouncesEmail(self): … … 470 475 # 471 476 def Create(self, name, admin, crypted_password, 472 477 langs=None, emailhost=None): 473 if Utils.list_exists(name):474 raise Errors.MMListAlreadyExistsError, name475 478 # Validate what will be the list's posting address. If that's 476 479 # invalid, we don't want to create the mailing list. The hostname 477 480 # part doesn't really matter, since that better already be valid. … … 479 482 # the admin's email address, so transform the exception. 480 483 if emailhost is None: 481 484 emailhost = mm_cfg.DEFAULT_EMAIL_HOST 482 postingaddr = '%s@%s' % (name, emailhost) 485 # default, for when no domain is given 486 firstname = name 487 # we set a special name for virtual hosted lists 488 if '@' in name: 489 firstname, emailhost = name.split('@', 1) 490 name = "%s-%s" % (firstname, emailhost) 491 # but we keep a sensible posting address 492 postingaddr = '%s@%s' % (firstname, emailhost) 483 493 try: 484 494 Utils.ValidateEmail(postingaddr) 485 495 except Errors.MMBadEmailError: 486 496 raise Errors.BadListNameError, postingaddr 487 497 # Validate the admin's email address 488 498 Utils.ValidateEmail(admin) 499 if Utils.list_exists(name): 500 raise Errors.MMListAlreadyExistsError, name 489 501 self._internal_name = name 490 502 self._full_path = Site.get_listpath(name, create=1) 491 503 # Don't use Lock() since that tries to load the non-existant config.pck 492 504 self.__lock.lock() 493 505 self.InitVars(name, admin, crypted_password) 494 506 self.CheckValues() 507 # this is for getListAddress 508 self.list_address = postingaddr 509 self.real_name = firstname 510 self.subject_prefix = mm_cfg.DEFAULT_SUBJECT_PREFIX % self.__dict__ 495 511 if langs is None: 496 512 self.available_languages = [self.preferred_language] 497 513 else: … … 1322 1338 addresses in the recipient headers. 1323 1339 """ 1324 1340 # This is the list's full address. 1325 listfullname = '%s@%s' % (self.internal_name(), self.host_name)1341 listfullname = self.getListAddress() 1326 1342 recips = [] 1327 1343 # Check all recipient addresses against the list's explicit addresses, 1328 1344 # specifically To: Cc: and Resent-to: … … 1337 1353 addr = addr.lower() 1338 1354 localpart = addr.split('@')[0] 1339 1355 if (# TBD: backwards compatibility: deprecated 1340 localpart == self. internal_name() or1356 localpart == self.real_name.lower() or 1341 1357 # exact match against the complete list address 1342 1358 addr == listfullname): 1343 1359 return True -
mailman/bin/rmlist
old new 92 92 usage(1) 93 93 listname = args[0].lower().strip() 94 94 95 if '@' in listname: 96 # note that --urlhost and --emailhost have precedence 97 firstname, domain = listname.split('@', 1) 98 listname = '%s-%s' % ( firstname, domain ) 99 95 100 removeArchives = False 96 101 for opt, arg in opts: 97 102 if opt in ('-a', '--archives'):
Note: See TracBrowser for help on using the browser.
