From patchwork Thu Oct 11 09:37:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Try to parse both RFC822-style and RFC2822-style In-Reply-To fields X-Patchwork-Submitter: Tollef Fog Heen X-Patchwork-Id: 191026 Message-Id: <1349948260-13197-1-git-send-email-tfheen@varnish-software.com> To: patchwork@lists.ozlabs.org Cc: Tollef Fog Heen Date: Thu, 11 Oct 2012 11:37:40 +0200 From: Tollef Fog Heen List-Id: Patchwork development --- apps/patchwork/bin/parsemail.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/patchwork/bin/parsemail.py b/apps/patchwork/bin/parsemail.py index b6eb97a..127ff8a 100755 --- a/apps/patchwork/bin/parsemail.py +++ b/apps/patchwork/bin/parsemail.py @@ -207,7 +207,10 @@ def find_patch_for_comment(project, mail): # construct a list of possible reply message ids refs = [] if 'In-Reply-To' in mail: - refs.append(mail.get('In-Reply-To')) + irt = re.findall(r"<[^>]+>", mail.get('In-Reply-To')) + for r in irt: + if r not in refs: + refs.append(r) if 'References' in mail: rs = mail.get('References').split()