When testing with headers with unencoded characters on Py3,
subject_check would fail. It was getting an Header class, rather
than a str/bytes, and so the regex was failing.
Run clean_header to decode everything fully first.
Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Stephen Finucane <stephen@that.guru>
"""Determine if a mail is a reply."""
comment_re = re.compile(r'^(re)[:\s]\s*', re.I)
- return comment_re.match(subject)
+ return comment_re.match(clean_header(subject))
def clean_content(content):