diff options
| author | bwarsaw | 2002-04-18 22:26:35 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-04-18 22:26:35 +0000 |
| commit | 43c735fe23ee8ee7cde69b8913a798a22dfb5af0 (patch) | |
| tree | 2785a4d0249ab19cb850cfaecc9cefb4c17665aa | |
| parent | bead45b1350d8cecc8d05d6dca0dfdd45c65b2d1 (diff) | |
| download | mailman-43c735fe23ee8ee7cde69b8913a798a22dfb5af0.tar.gz mailman-43c735fe23ee8ee7cde69b8913a798a22dfb5af0.tar.zst mailman-43c735fe23ee8ee7cde69b8913a798a22dfb5af0.zip | |
CheckValues(): Watch for bad patterns in topics and discard them if
found. The Topics gui will catch these for newly defined patterns,
but there may be some legacy topic patterns in the list config.
| -rw-r--r-- | Mailman/MailList.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 075d8baa2..20445f037 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -620,7 +620,17 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, self.reply_to_address, self.internal_name()) self.reply_to_address = '' self.reply_goes_to_list = 0 - + # Legacy topics may have bad regular expressions in their patterns + goodtopics = [] + for name, pattern, desc, emptyflag in self.topics: + try: + re.compile(pattern) + except (re.error, TypeError): + syslog('error', 'Bad topic pattern "%s" for list: %s', + pattern, self.internal_name()) + else: + goodtopics.append((name, pattern, desc, emptyflag)) + self.topics = goodtopics # |
