diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-02-05 10:39:00 -0500 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-02-05 10:39:00 -0500 |
commit | ba85ee3239667a799f729940f4256789a9f86ad3 (patch) | |
tree | 5aadfbeb654e365b4df755cf3540565394f894c1 | |
parent | c6af8cdfac11fd9ba5514adcb01220c188fde544 (diff) | |
download | korg-helpers-ba85ee3239667a799f729940f4256789a9f86ad3.tar.gz |
Better support for odder msgid headers
Found an In-Reply-To that was not just a <foo>, so handle those cases
better with a regex.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-x | get-lore-mbox.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/get-lore-mbox.py b/get-lore-mbox.py index bfe8b0b..e3599ed 100755 --- a/get-lore-mbox.py +++ b/get-lore-mbox.py @@ -202,9 +202,12 @@ def git_add_trailers(payload, trailers): def get_clean_msgid(msg, header='Message-ID'): - msgid = msg.get(header) - if msgid: - msgid = msg.get(header).strip().strip('<>') + msgid = None + raw = msg.get(header) + if raw: + matches = re.search(r'<([^>]+)>', raw) + if matches: + msgid = matches.groups()[0] return msgid |