From 0862b9b9f2dfcc600b1b2c0a6f5d5e7cc35164e4 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Mon, 19 Oct 2020 08:35:00 -0400 Subject: Fix Link: and Cc: trailer recognition Link is a non-person trailer, so should be recognized as such. Cc is a person-trailer but we always expected that to include <> surrounding the address, which is not correct in all cases. Reported-by: Greg Kroah-Hartman Reported-by: Johan Hovold Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/b4/__init__.py b/b4/__init__.py index 9cd1f87..364e3f0 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -1177,7 +1177,7 @@ class LoreMessage: @staticmethod def find_trailers(body): headers = ('subject', 'date', 'from') - nonperson = ('fixes', 'subject', 'date') + nonperson = ('fixes', 'subject', 'date', 'link') # Fix some more common copypasta trailer wrapping # Fixes: abcd0123 (foo bar # baz quux) @@ -1203,7 +1203,7 @@ class LoreMessage: if len(others) and tname in headers: logger.debug('Ignoring %s (header after other content)', line) continue - mperson = re.search(r'<\S+@\S+\.\S+>', groups[1]) + mperson = re.search(r'\S+@\S+\.\S+', groups[1]) if not mperson and tname not in nonperson: logger.debug('Ignoring %s (not a recognized non-person trailer)', line) continue -- cgit v1.2.3