Skip to content

Commit 4ef8e46

Browse files
committed
update
1 parent 68ea283 commit 4ef8e46

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Mailman/Utils.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,3 +1735,17 @@ def validate_ip_address(ip):
17351735
pass
17361736

17371737
return False, None
1738+
1739+
def ValidateListName(listname):
1740+
"""Validate a list name against the acceptable character pattern.
1741+
1742+
Args:
1743+
listname: The list name to validate
1744+
1745+
Returns:
1746+
bool: True if the list name is valid, False otherwise
1747+
"""
1748+
if not listname:
1749+
return False
1750+
# Check if the list name contains any characters not in the acceptable pattern
1751+
return len(re.sub(mm_cfg.ACCEPTABLE_LISTNAME_CHARACTERS, '', listname)) == 0

0 commit comments

Comments
 (0)