MAIF / melusine

📧 Melusine: Use python to automatize your email processing workflow
https://maif.github.io/melusine
Other
352 stars 58 forks source link

Deal_with_drafts #136

Open ghost opened 2 years ago

ghost commented 2 years ago

Hey !

We found an error during our utilisation of Melusine.

When we use the function get_emails() to load the emails, it will raise an error if it encounters a draft. image

Some drafts have no sender or datetime_sent attributes, so it will raise an error in the function _extract_email_attributes().

I will join a PR with the solution we proposed to deal with drafts in the file tree. For each email, we look if it has a datetime_sent and sender attributes. If it's not the case, we replace these attributes by None values. image

If you have other ideas to deal with this issue, we are listening !

We already told the users of the mailbox to delete drafts in the file tree or move them in the folder "Brouillon". But It may be safer to have a way to deal with a draft forgotten in the file tree, instead of having our script for the training of the DL model (which can be long) failed because of one draft.

Best regards,

Maxime

Python version : 3.9.7

Melusine version : 2.3.4

Operating System : Windows

TFA-MAIF commented 2 years ago

Hello,

Thank you for both issues and PR associated. We will take a look at it and plan integration :)

Best regards