martinrusev / imbox

Python IMAP for Human beings
MIT License
1.18k stars 190 forks source link

fix for #196 #197

Closed mdavino closed 2 years ago

mdavino commented 3 years ago

For some pdf attachments the filename field is empty. This is because sometimes the file name is indicated in the content-type field.

https://docs.python.org/3/library/email.message.html#email.message.EmailMessage get_filename(failobj=None)¶ Return the value of the filename parameter of the Content-Disposition header of the message. If the header does not have a filename parameter, this method falls back to looking for the name parameter on the Content-Type header. If neither is found, or the header is missing, then failobj is returned. The returned string will always be unquoted as per email.utils.unquote().

ghost commented 3 years ago

Do you have an example which can be used for a testcase?

mdavino commented 3 years ago

Can i attach the mail file .eml

mail-test.zip