Skip to content

Commit 21df7d7

Browse files
committed
update
1 parent 7bf6ae4 commit 21df7d7

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

Mailman/MailList.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def __init__(self, name=None, lock=1):
9797
# contains shell special characters so allow only defined characters
9898
# (default = '[-+_.=a-z0-9]').
9999
pattern = mm_cfg.ACCEPTABLE_LISTNAME_CHARACTERS.replace('-', r'\-')
100-
if len(re.sub(r'[%s]' % pattern, '', name)) > 0:
100+
if len(re.sub(r'[%s]' % pattern, '', name, flags=re.IGNORECASE)) > 0:
101101
raise Errors.BadListNameError(name)
102102
# Validate what will be the list's posting address
103103
postingaddr = '%s@%s' % (name, mm_cfg.DEFAULT_EMAIL_HOST)

bin/update

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,24 @@ def main():
993993
if lastversion == FRESH:
994994
print(C_('This appears to be a fresh installation.'))
995995
print(C_('No upgrade is necessary.'))
996+
# Early check: try to load all lists and print a summary
997+
list_names = Utils.list_names()
998+
ok = 0
999+
fail = 0
1000+
for listname in list_names:
1001+
try:
1002+
if isinstance(listname, bytes):
1003+
listname = listname.decode('utf-8', 'replace')
1004+
listname = listname.lower()
1005+
mlist = MailList.MailList(listname, lock=0)
1006+
ok += 1
1007+
except Exception as e:
1008+
fail += 1
1009+
print(' [WARN] Could not load list "%s": %s' % (listname, str(e)))
1010+
if fail == 0:
1011+
print('All %d lists loaded successfully, no upgrade necessary.' % ok)
1012+
else:
1013+
print('%d lists loaded successfully, %d lists had errors. No upgrade necessary.' % (ok, fail))
9961014
sys.exit(0)
9971015

9981016
# If this is not a fresh install, but we can't determine the last version,
@@ -1008,6 +1026,24 @@ version number. You must use the -f flag to force the upgrade."""))
10081026
# If the versions match, we don't need to do anything
10091027
if lastversion == thisversion and not args.force:
10101028
print(C_('No upgrade is necessary.'))
1029+
# Early check: try to load all lists and print a summary
1030+
list_names = Utils.list_names()
1031+
ok = 0
1032+
fail = 0
1033+
for listname in list_names:
1034+
try:
1035+
if isinstance(listname, bytes):
1036+
listname = listname.decode('utf-8', 'replace')
1037+
listname = listname.lower()
1038+
mlist = MailList.MailList(listname, lock=0)
1039+
ok += 1
1040+
except Exception as e:
1041+
fail += 1
1042+
print(' [WARN] Could not load list "%s": %s' % (listname, str(e)))
1043+
if fail == 0:
1044+
print('All %d lists loaded successfully, no upgrade necessary.' % ok)
1045+
else:
1046+
print('%d lists loaded successfully, %d lists had errors. No upgrade necessary.' % (ok, fail))
10111047
sys.exit(0)
10121048

10131049
# If this is a downgrade, we need to force it

0 commit comments

Comments
 (0)