Exception while listing messages in inbox (ExchangeClient)

The ListMessages method throws the following error, probably because it doesn't like a particular message in the inbox. This stops the complete operation and doesn't allow any messages to be fetched. Pretty serious.....

2009-07-15 15:34:21.8122|Error|System.FormatException: The specified string is not in the form required for an e-mail address.
at Aspose.Network.Mime.xe8b0369f54f4b3bc.x25437dba01d1e3b4(String x4a3f0a05c02f235f, Int32& x374ea4fe62468d0f, String& xf0d47d7698b4e263)
at Aspose.Network.Mime.xe8b0369f54f4b3bc.x25437dba01d1e3b4(String x4a3f0a05c02f235f, Int32& x374ea4fe62468d0f)
at Aspose.Network.Mail.MailAddressCollection.x0738845e2abbf3d2(String xfcd52643efa0e563)
at Aspose.Network.Mail.MailAddressCollection.Add(String addresses)
at Aspose.Network.Exchange.ExchangeMessageInfo.x19890931227f0f56(x9b55ae2d3850d157 xe464d907306ccb86, ExchangeMessageInfo& x02f8da7b6171e2e6)
at Aspose.Network.Exchange.ExchangeMessageInfoCollection.x1f490eac106aee12(x9b55ae2d3850d157[] x94d801a1518a39e4)
at Aspose.Network.Exchange.ExchangeClient.ListMessages(String folder, Boolean recursive)

Could you please have a look at this issue.We're using version 4.7.1.0

Regards

Bart

Hi Bart,

It looks like some mail address parsing issue. Is there any chance you get the eml file to me? You can save them by calling the ExchangeClient.Save(string).

Thanks

Hi

To save the message I need the URL which I obtain from ListMessages, which fails.

I'll try to connect with Outlook and check if I see anything strange, but the inbox has hundreds of messages so it will be hard to find the one ListMessages is failing on...

Maybe something can be changed in the raised exception e.g add the url of the message it fails on??

Regards,

Bart

Hi Bart,

Could you please try to use the attached dll? Let me know if it works, or send me the exception.ToString.

Thank you very much.

Hi

Sorry for my late response.

This version of the DLL works fine, the exception is gone. Thank you.

Is this fix included in the latest 4.7.2 release?

Regards

Bart van Haaff

Hi

Unfortunately it hit another exception with the same result; it cannot list the messages in the inbox although now the URL is included which helps a lot.

The message ‘from’ address is: “alert@notification.messagelabs.com [alert@notification.messagelabs.com]

The exception is:

10:56:34 Error Aspose.Network.Mime.MimeException: Unknown errors in message parser.

Uri: http://…/Inbox/WARNING.%20Someone%20sent%20you%20a%20potential%20virus%20or%20unauthorised%20code.EML —> System.FormatException: The specified e-mail address is currently not supported.

at Aspose.Network.xe8b0369f54f4b3bc.x25437dba01d1e3b4(String x4a3f0a05c02f235f, Int32& x374ea4fe62468d0f, String& xf0d47d7698b4e263)

at Aspose.Network.xe8b0369f54f4b3bc.x25437dba01d1e3b4(String x4a3f0a05c02f235f, Int32& x374ea4fe62468d0f)

at Aspose.Network.Mail.MailAddressCollection.x0738845e2abbf3d2(String xfcd52643efa0e563)

at Aspose.Network.Mail.MailAddressCollection.Add(String addresses)

at Aspose.Network.Exchange.x5f2c9abe38210e5b.x19890931227f0f56(x9b55ae2d3850d157 xe464d907306ccb86, x5f2c9abe38210e5b& x02f8da7b6171e2e6)

— End of inner exception stack trace —

at Aspose.Network.Exchange.x5f2c9abe38210e5b.x19890931227f0f56(x9b55ae2d3850d157 xe464d907306ccb86, x5f2c9abe38210e5b& x02f8da7b6171e2e6)

at Aspose.Network.Exchange.x3cab03e88375b0d0.x1f490eac106aee12(x9b55ae2d3850d157[] x94d801a1518a39e4)

at Aspose.Network.Exchange.ExchangeClient.ListMessages(String folder, Boolean recursive)

at VSP.Service.MailReader.Process()

at VSP.Service.Service.ProcessExchange()

Please have a look…

Thanks a lot

Bart van Haaff

Guys, now running 4.8 but still the same issue with some messages:

Aspose.Network.Mime.MimeException: Unknown errors in message parser. Uri: http://.../Postvak%20IN/No%20Subject-7.EML —> System.ArgumentException: The parameter ‘addresses’ cannot be an empty string. Parameter name: addresses at Aspose.Network.Mail.MailAddressCollection.Add(String addresses) at Aspose.Network.Exchange.x5f2c9abe38210e5b.x19890931227f0f56(x9b55ae2d3850d157 xe464d907306ccb86, x5f2c9abe38210e5b& x02f8da7b6171e2e6) — End of inner exception stack trace — at Aspose.Network.Exchange.x5f2c9abe38210e5b.x19890931227f0f56(x9b55ae2d3850d157 xe464d907306ccb86, x5f2c9abe38210e5b& x02f8da7b6171e2e6) at Aspose.Network.Exchange.x3cab03e88375b0d0.x1f490eac106aee12(x9b55ae2d3850d157[] x94d801a1518a39e4) at Aspose.Network.Exchange.ExchangeClient.ListMessages(String folder, Boolean recursive) at …

All I can do is delete the message, otherwise I can no longer list messages in the inbox … not good.

Please help

Regards

Bart

Hello,

Could you please send me the eml file for the investigation? Looks like some address fields are missed in the eml file.

Thanks,

Sorry, have no EML, had to delete the message immediately to restore production. By the way, Outloook Web interface had no problem with the message.

I had similar problems with ExchangeClient.ListMessages and it can be quite a big problem if everything stops because of one message that can’t be parsed. Someone has to search for the message and remove it… you can imagine that in a critical production environment with potentially thousands of messages this a disaster.
It seems like we need a better ListMessages method that is more resilient to the errors on a single message level. It definitevely shouldn’t just throw an exception and stop.

cheers
Robert

Hi Robert,

We are fixing this issue. I will keep you posted.

thanks,

Hi,

Please check the attached dll for this issue.

Thanks,

Hi

Got this version running in production for a couple of days now. So far so good. I'll let you know if anything comes up.

Regards and thanks a lot for your support!

Bart van Haaff

Hi

I haven't seen this issue anymore so I guess we can consider it solved!

Thanks for solving this

Bart