We use the GraphAPI java 22.9 version and have been successfully reading emails from an MS mailbox using listMessages() and fetchMessage(msg.getItemId()) and then delete(msg.getItemId()) for some time now. As of recently we are seeing the below situation.
1 item ID MzoxNTI6NDI6MjY6MDowOkFBTWtBRGcwTlRsaU16RTFMVFl3T1RRdE5HWm1OUzFpTldZMExUTXpOVFF3WW1NMk9UVTVOQUJHQUFBQUFBRHg1TzB2cklZVFJMcklubkRzcTJKckJ3Q3k5d0hLV1Q2RVNyZHJvYzVnOVIwYUFBQUFBQUVNQUFDeTl3SEtXVDZFU3Jkcm9jNWc5UjBhQUFIYlZ4dWhBQUE9Vy8iUUFBQUJZQUFBQ3k5d0hLV1Q2RVNyZHJvYzVnOVIwYUFBSGJWOC8ibWFpbEZvbGRlcnMvaW5ib3gvbWVzc2FnZXM=
message ID <DS7PR11MB59678148CB301C46EFC3C110E5879@DS7PR11MB5967.namprd11.prod.outlook.com>
subject Re: Testing
date Thu Mar 23 13:07:41 MDT 2023
2 item ID MzoxNTI6NDI6MjY6MDowOkFBTWtBRGcwTlRsaU16RTFMVFl3T1RRdE5HWm1OUzFpTldZMExUTXpOVFF3WW1NMk9UVTVOQUJHQUFBQUFBRHg1TzB2cklZVFJMcklubkRzcTJKckJ3Q3k5d0hLV1Q2RVNyZHJvYzVnOVIwYUFBQUFBQUVNQUFDeTl3SEtXVDZFU3Jkcm9jNWc5UjBhQUFIYlZ4dWdBQUE9Vy8iUUFBQUJZQUFBQ3k5d0hLV1Q2RVNyZHJvYzVnOVIwYUFBSGJWOC8ibWFpbEZvbGRlcnMvaW5ib3gvbWVzc2FnZXM=
message ID <DS7PR11MB5967BFFA93F31A4A3FE0BF1AE5879@DS7PR11MB5967.namprd11.prod.outlook.com>
subject Re: Testing
date Thu Mar 23 13:07:37 MDT 2023
We call fetchMessage with the item id successfully. We process the email and then call delete for the item id successfully. We then try to read and delete the second message returned by listMessages but since we deleted it already we get failures because the itemId is not unique.
I tried using getMessageId() as I know it is unique but fetchMessage threw an exception when I pass the message Id as the parameter.
com.aspose.email.system.exceptions.FormatException: The string contains invalid characters
at com.aspose.email.internal.b.zh.j(Unknown Source)
at com.aspose.email.zzi.b(SourceFile:249)
at com.aspose.email.zzi.c(SourceFile:283)
at com.aspose.email.zyw.(SourceFile:62)
at com.aspose.email.zyi.fetchMessage(SourceFile:250)
I see in 22.7 release notes some discussion of what seems similar and possibly addressed by obtaining a UID or sequence number, but I don’t see that available in the 22.9 java graph api.
@mlittle4444
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): EMAILJAVA-35156
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Thank you for the quick reply and putting this on your schedule. Will this require a license renewal for 2023, any idea on typical turnaround for something like this?
You cannot use MessageId on the fetchMessage method. Only the ItemID can be used to fetch a message.
The ItemID is unique for both messages(1,2):
..>h<BQUE9Vy8iU..
..>d<BQUE9Vy8iU..
Could you give us more details about the delete error:
We then try to read and delete the second message returned by listMessages but since we deleted it already we get failures because the itemId is not unique.
Sorry, my bad didn’t notice the 1 char diff. I attached 2 log files. The results I am getting today are different, one is with delete on the 1st message, the other failure to fetch the second message. Also, it seems this started happening a couple months ago if that is helpful, maybe there was an IT change in Comcast’s email system, not sure, but we didn’t change code(your library or the way we are using your library). One of the problems I recreated today was when the originators were different. I don’t think I have seen this occur when we only process 1 message. Let me know if there is anything else I can collect for you. thank you!
-Djava.util.logging.config.file=/full/path/to/logging.properties
// or
System.setProperty("java.util.logging.config.file", "/full/path/to/logging.properties");
logging.properties:
handlers = java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level = FINEST
sun.net.www.protocol.http.HttpURLConnection.level = ALL
Couldn’t manage to get that logging working that way, tried for some time and got pulled away. I was able to get some networking details via System.setProperty(“javax.net.debug”, “all”). Attaching log for scenario where 1st message read successfully and deleted successfully, but 2nd message creates an exception even though http response for the fetchMessage appears to be 200 OK. msg1good_msg2readexception.pdf (826.5 KB)
Here are those results with scenario of Message 1 success on read and delete, Message 2 failure on read. thankstls12_msg1good_msg2readfail.docx (299.3 KB)