Some mail, particularly those generated with older versions of
git-send-email or written by hand, include some extra whitespace in the
'References' and 'In-Reply-To' lines. Ensure we always strip this,
preventing mismatches between this and 'Message-ID', which is already
stripped of whitespace, when looking up SeriesReference's.
Signed-off-by: Stephen Finucane <stephen@that.guru>
refs = []
if 'In-Reply-To' in mail:
- refs.append(mail.get('In-Reply-To'))
+ refs.append(mail.get('In-Reply-To').strip())
if 'References' in mail:
rs = mail.get('References').split()
rs.reverse()
for r in rs:
+ r = r.strip()
if r not in refs:
refs.append(r)