Adding re.DOTALL to catch potentially folded lines and fixed formatting

This commit is contained in:
Joseph Ishac 2021-04-14 17:08:16 -04:00
parent a4532294ae
commit 84b96e1daa

View File

@ -243,7 +243,8 @@ class MaildirFolder(BaseFolder):
# quoted boundaries.
try: boundary_field = \
re.search(b"content-type:.*(boundary=[\"]?[A-Za-z0-9'()+_,-./:=? ]+[\"]?)",
re.split(b'[\r]?\n[\r]?\n',raw_msg_bytes)[0],re.IGNORECASE).group(1)
re.split(b'[\r]?\n[\r]?\n', raw_msg_bytes)[0],
(re.IGNORECASE|re.DOTALL)).group(1)
except AttributeError:
# No match
return raw_msg_bytes