-
Notifications
You must be signed in to change notification settings - Fork 13
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
Unable to cast object of type 'MimeKit.TextPart' to type 'MimeKit.MessagePart' #5
Comments
I think issue is in file BounceDetectResult.cs on line 182 |
Please, create a (failing) unit test that triggers this behavior. |
I am new to GitHub so sorry for maybe wrong editing. I hope you'll find all my proposed changes in few patches |
I'm running into the same issue. In debugging down to this, the UndeliveredMessagePart does not contain a member of 'Message', so the exception is thrown. I'd like to help out with this, but haven't got any idea how to create a failing unit test. I have a couple of these bounces in a folder on an inbox, I can forward them to you- they are AOL bounces. For the time being, I've just commented this segment out, as I'm not interested in the UndeliveredMessageId, but I know this isn't something that's a good option for most. |
In addition to ToddHedenstrom's comment I added extension method: public static bool HasMethod(this object objectToCheck, string methodName) And changed line 179 to: if (UndeliveredMessagePart != null && UndeliveredMessagePart.HasMethod("Message")) Now works well with message id. |
I have this
System.InvalidCastException: Unable to cast object of type 'MimeKit.TextPart' to type 'MimeKit.MessagePart'.
at MailBounceDetector.BounceDetectResult..ctor(MimeMessage message, MimeEntity deliveryNotification, MessageDeliveryStatus deliveryStatus, MimeEntity undeliveredMessagePart)
at MailBounceDetector.StandardBounceDetector.Detect(MimeMessage message)
at MailBounceDetector.BounceDetector.Detect(MimeMessage message)
The text was updated successfully, but these errors were encountered: