You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2020/08/10 17:32:50 UTC

[incubator-ponymail] branch master updated: Be more lenient in List-ID parsing

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

humbedooh 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 168ee1d  Be more lenient in List-ID parsing
168ee1d is described below

commit 168ee1dfd86b8e63d6f4d8b5a9b9bcd544d6e47a
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Mon Aug 10 19:32:43 2020 +0200

    Be more lenient in List-ID parsing
    
    This fixes #511
---
 tools/archiver.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/archiver.py b/tools/archiver.py
index 2c50f19..be68a52 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -118,7 +118,12 @@ def pm_charsets(msg):
 
 def normalize_lid(lid): # N.B. Also used by import-mbox.py
     """ Ensure that a lid is in standard form, i.e. <a.b.c.d> """
-    # first drop any leading or trailing chars
+    # If of format "list name" <foo.bar.baz>
+    # we crop away the description (#511)
+    m = re.match(r'".*"\s+(.+)', lid)
+    if m:
+        lid = m.group(1)
+    # Drop <> and anything before/after, if found
     m = re.search(r"<(.+)>", lid)
     if m:
         lid = m.group(1)