MAIF / melusine

📧 Melusine: Use python to automatize your email processing workflow

Home Page:https://maif.github.io/melusine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deal_with_drafts

opened this issue · comments

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

Hello,

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

Best regards