-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle exceptions thrown while getting message ID #170
Handle exceptions thrown while getting message ID #170
Conversation
Python's email library can throw both an IndexError as well as a HeaderParseError when the email has certain invalid data in the message ID. This prevents users with faulty emails from syncing. This change allows us to simply continue without a message ID as was intended in the code before anyway. Signed-off-by: Florian Snow <[email protected]>
74c10a7
to
66fa8b7
Compare
This patch resolves #119 for me, thanks! |
Thank you, this patch fixed an email header for me too. |
Hi @floriansnow , Thanks a lot for your patch! I applied other patch that have conflicts with this. In this patch, msg_id is None, but in the other patch msg_id is set to "[broken message-id]" @floriansnow Is it ok for you? Best regards,
|
Hi @thekix! Thanks for letting me know!
In this patch here, The exception handling in master seems overly broad, though. I mean catching any exception will fix the issue, but I think usually, it would be best to only catch specific exceptions which is what I did in my patch. Feel free to close this as either patch will fix the bug; you can probably judge better if the distinction between a broken and an unknown message ID is useful and whether broad exception handling might introduce additional bugs. |
Hi @floriansnow Thanks a lot for your reply. Yes, I agree with you about the broad exception. About the msg_id info, with the What do you think about include this changes like:
If you agree, because you are de author of this patch/idea, do you like tu create the new PR? Again, thanks a lot. Best Regards, |
Hi, I included this change in this commit: 47f74c4 I will close this PR. Again, thanks a lot @floriansnow |
Python's email library can throw both an IndexError as well as a HeaderParseError when the email has certain invalid data in the message ID. This prevents users with faulty emails from syncing. This change allows us to simply continue without a message ID as was intended in the code before anyway.
This PR
References
Additional information
Closes #119.
I am wondering whether we should catch some more exceptions in similar cases and also fix things like #160 along the way.