coddingtonbear / django-mailbox

Import mail from POP3, IMAP, local email mailboxes or directly from Postfix or Exim4 into your Django application automatically.
MIT License
356 stars 164 forks source link

Close attachments #273

Closed martinmanzo closed 8 months ago

martinmanzo commented 1 year ago

I'm working with LOTS of mails with attachments on them and started getting OS errors stating that too many files were open.

I changed the code so to close the files after reading them in order to avoid potential memory leaks and other unexpected behaviors.

Test passed OK.

pfouque commented 8 months ago

I agree, it looks safe but deserve to be tested! 😉