diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-10-21 11:33:21 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-10-21 11:33:21 -0400 |
commit | ebb4f5797aec4bf2c8cdc116aecdbd698468d62e (patch) | |
tree | f4d027e6ea8b8ae10e29fbefbbc31743ef142381 | |
parent | 9426618979ca1c6c5e32b552bdbd3af10688b4a0 (diff) | |
download | korg-helpers-ebb4f5797aec4bf2c8cdc116aecdbd698468d62e.tar.gz |
list-archive-maker: fix msgmap.sqlite3 support
The message-id's in msgmap.sqlite3 are without <>, which we actually use
for mapping.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-x | list-archive-maker.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/list-archive-maker.py b/list-archive-maker.py index 801d840..c619ede 100755 --- a/list-archive-maker.py +++ b/list-archive-maker.py @@ -153,6 +153,9 @@ def process_archives(sources: List[str], outdir: str, knownset: Set[str], listid dupmsgid += 1 continue + if extrahdrs: + msg._headers += extrahdrs # noqa + # Remove headers not in WANTHDRS list and any Received: # lines that do not mention the list email address newhdrs = list() @@ -160,7 +163,7 @@ def process_archives(sources: List[str], outdir: str, knownset: Set[str], listid cc = list() recvtime = None is_our_list = False - for hdrname, hdrval in list(msg._headers): # noqa + for hdrname, hdrval in list(msg._headers): # noqa lhdrname = hdrname.lower() lhdrval = hdrval.lower() wanthdr = False @@ -261,9 +264,6 @@ def process_archives(sources: List[str], outdir: str, knownset: Set[str], listid notourlist += 1 continue - if extrahdrs: - newhdrs += extrahdrs - msg._headers = newhdrs msgdate = recvtime @@ -322,7 +322,7 @@ def main(args: argparse.Namespace): dbconn = sqlite3.connect(args.known_ids, sqlite3.PARSE_DECLTYPES | sqlite3.PARSE_COLNAMES) cur = dbconn.cursor() rows = cur.execute('SELECT mid FROM msgmap').fetchall() - knownids = {x[0] for x in rows} + knownids = {f'<{x[0]}>' for x in rows} else: with open(args.known_ids, 'r') as fh: knownids = set(fh.read().splitlines()) |