remove newlines from email attachments as cannot be handled

This commit is contained in:
robert schouten 2017-03-08 15:58:26 +08:00
parent 28b38d45e7
commit fdb8a1a763

View file

@ -386,6 +386,7 @@ class Email:
fname = part.get_filename()
if fname:
try:
fname = fname.replace('\n', ' ').replace('\r', '')
fname = cstr(decode_header(fname)[0][0])
except:
fname = get_random_filename(content_type=content_type)