Bounce Inspector, NET 5 and "Object reference not set to an instance of an object."

Hello, I'm trying the library on a .NET 5 project. I have some bounced emails in the inbox (from different servers) but when checking with the library, I see that it doesn't get Identified as bounced. When inspectng in debug, I see that the BounceResultCollection has an error: {ComponentPro.Net.Mail.BounceResult} Addresses: null BounceCategory: null BounceType: null Delete: false Dsn: null Error: {"Object reference not set to an instance of an object."} FileDeleted: false FilePath: null Identified: false InboxDelete: false InboxDeleted: false MailMessage: null SequenceNumber: 0 SignatureId: -1 Skipped: false Tag: null UniqueId: null specifically the result error is: {"Object reference not set to an instance of an object."} Data: {System.Collections.ListDictionaryInternal} HResult: -2147467261 HelpLink: null InnerException: null Message: "Object reference not set to an instance of an object." Source: "ComponentPro.BounceInspector.NetCore" StackTrace: " at ComponentPro.Net.Mail.BounceInspector.c_e8156728(String )\r\n at ComponentPro.Net.Mail.BounceInspector.c_ce871252(Imap , String , ImapMessageCollection , String , AsyncOperation )" TargetSite: {System.String c_e8156728(System.String)} Any clue of what I'm missing? The code is pretty straightforward from the documentation: filter.Processed = MessageProcessed; ImapMessageCollection list = client.ListMessages(ImapEnvelopeParts.MessageInboxIndex | ImapEnvelopeParts.Size, ImapCriterion.DontHaveFlags(ImapMessageFlags.Seen)); // Process all messages. BounceResultCollection result = await filter.ProcessMessagesAsync(client, config["bounce"]["workingFolder"].ToString(), list, mailsPath); // Display processed emails. foreach (BounceResult r in result) { // If this is a detected bounce. if (r.Identified) { logger.Info("FileName: {0}\nSubject: {1}\nAddress: {2}\nBounce Category: {3}\nBounce Type: {4}\nDeleted: {5}\nDSN Action: {6}\nDSN Diagnostic Code: {7}\n\n", System.IO.Path.GetFileName(r.FilePath), r.MailMessage.Subject, r.Addresses[0], r.BounceCategory.Name, r.BounceType.Name, r.FileDeleted, r.Dsn.Action, r.Dsn.DiagnosticCode); } }
asked 3/22/2021 4:23:19 PM
add a comment

0 Answers

Your Answer

Not the answer you're looking for? Browse other questions tagged ultimate bounce inspector or ask your own question.