Fixed oversight in regular expression (boundary cannot be empty)

This commit is contained in:
Joseph Ishac 2021-04-14 11:14:44 -04:00
parent b78af75064
commit 0345390aa1

View File

@ -241,7 +241,7 @@ class MaildirFolder(BaseFolder):
# soft fix this message to resolve the python library looking for properly # soft fix this message to resolve the python library looking for properly
# quoted boundaries. # quoted boundaries.
try: boundary_field = \ try: boundary_field = \
re.search(b"content-type:.*(boundary=[\"]?[A-Za-z0-9'()+_,-./:=? ]*[\"]?)", 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).group(1)
except AttributeError: except AttributeError:
# No match # No match