You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2018/02/20 19:46:12 UTC

[incubator-ponymail] branch master updated: Bug: Inconsistent LID validation

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git


The following commit(s) were added to refs/heads/master by this push:
     new fb0dde9  Bug: Inconsistent LID validation
fb0dde9 is described below

commit fb0dde9404335fe4b8cb4b4c599d2e6962c2d834
Author: Sebb <se...@apache.org>
AuthorDate: Tue Feb 20 19:46:10 2018 +0000

    Bug: Inconsistent LID validation
    
    This fixes #356
---
 CHANGELOG.md      | 2 +-
 tools/archiver.py | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 03e8cf7..89646e7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,7 @@
 ## Changes in 0.11-SNAPSHOT
 - Bug: Indentation in mail content (leading white-space) not shown (#432)
 - Bug: does not make sense to allow empty domain name in LID (#434)
-- Bug: Inconsistent LID validation - don't require min 3 chars (#356)
+- Bug: Inconsistent LID validation (#356)
 
 ## CHANGES in 0.10:
 - Bug: Use correct dependency order to fix OAuth login problem (#431)
diff --git a/tools/archiver.py b/tools/archiver.py
index 85bdfd3..bc31974 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -128,7 +128,11 @@ def normalize_lid(lid):
     if m:
         lid = m.group(1)
     # Belt-and-braces: remove possible extraneous chars
-    return "<%s>" % lid.strip(" <>").replace("@", ".")
+    lid = "<%s>" % lid.strip(" <>").replace("@", ".")
+    if not re.match(r"^<.+\..+>$", lid):
+        print("Invalid list-id %s" % lid)
+        sys.exit(-1)
+    return lid
 
 class Archiver(object):
     """ A mailman 3 archiver that forwards messages to pony mail. """

-- 
To stop receiving notification emails like this one, please contact
sebb@apache.org.