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: |