Cannot handle URI in Calendar

If there is a text/calendar attachment with line like below:

ATTACH;VALUE=URI:abcdef

When convert the email from text to MapiMessage, it will throw exception:
MailMessage mailMsg = MailMessage.load(is, mailLoadOption)
MapiMessage.fromMailMessage(mailMsg, mapiConversionOption);

It will throw exception at MapiMessage.fromMailMessage:

class com.aspose.email.system.exceptions.UriFormatException: Invalid URI: The format of the URI could not be determined: abcdef

@curtisyamada,

I have observed the issue shared by you and request you to please share the MSG file that you are loading via MapiMessage. I will be able to investigate that further on my end on provision of requested information. Please also first try using latest Aspose.Email 20.1 on your end as well.

Just add the line:
ATTACH;VALUE=URI:abcdef

To any calendar EML file, then tried to convert it to MSG, then you will get the exception.

@curtisyamada,

Thank you for providing explanation. However, in order to proceed further with investigation on our end and adding the issue in our issue tracking system, we need to have source file and used sample code reproducing the issue on your end. We will fix the issue on that basis and will notify you accordingly for verification once it will be fixed. I will really appreciate your cooperation in this regard.

Below is a sample calendar

To: [test@test.com](mailto:test@test.com)
From: [test@test.com](mailto:test@test.com)
Subject: test
Message-ID: <8ed9366d-d3ad-06e5-3da4-9fb9c3f4d3ed>
Date: Thu, 12 Mar 2020 09:23:58 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.5.0
Content-Type: multipart/mixed;
boundary="------------490F189610F77532D7635A64"
Content-Language: en-US
MIME-Version: 1.0

--------------490F189610F77532D7635A64
Content-Type: text/plain; charset=“utf-8”; format=flowed
Content-Transfer-Encoding: 7bit

this is a calendar test

--------------490F189610F77532D7635A64
Content-Type: text/calendar; charset=“UTF-8”; method=REPLY
Content-Transfer-Encoding: 7bit

BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REPLY
BEGIN:VEVENT
DTSTART:20160127T180000Z
DTEND:20160127T183000Z
DTSTAMP:20160121T172116Z
[ORGANIZER;CN=test@test.com](mailto:ORGANIZER;CN=test@test.com): mailto:test@test.com
UID:040000008200E00074C5B7101A82E00800000000C08838382454D101000000000000000
0100000005E182D6D009ACB42912846402434EB61
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Test
[Bruton;X-NUM-GUESTS=0:mailto:test@test.com](mailto:Bruton;X-NUM-GUESTS=0:mailto:test@test.com)
CREATED:20160121T170508Z
DESCRIPTION:\n\n
LAST-MODIFIED:20160121T172116Z
LOCATION:Test to call Tom @ 123-456-8499
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:CALL: test user & test user2
TRANSP:OPAQUE
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-OWNERAPPTID:-1766516768
X-MICROSOFT-DISALLOW-COUNTER:FALSE
BEGIN:VALARM
ACTION:AUDIO
TRIGGER:-PT15M
X-WR-ALARMUID:E8A71214-DFA7-4C6F-AEC9-85173A1AFABF
UID:E8A71214-DFA7-4C6F-AEC9-85173A1AFABF
X-APPLE-DEFAULT-ALARM:TRUE
ATTACH;VALUE=URI:Basso
END:VALARM
END:VEVENT
END:VCALENDAR

--------------490F189610F77532D7635A64–

@curtisyamada,

I have tried working with calendar file shared by you and created ICS file with that. However, there seems to be an issue with attached file as API is throwing exception: Incorrect message format. Please check and share in the form of a valid file that is reproducing issue so that we may test it on our end.

TestCal.zip (1.1 KB)

The file I added is an EMAIL file, not a ICS file.
You should parse it as an EML.
This is aspose.email forum. So I was talking about calendar inside EMAIL.
Why you think that the file I attached is ICS file…
If you read it, it’s clear an EMAIL

@curtisyamada,

I am sorry for your inconvenience. I have saved thee file as EML and have not found any issue while using your sample code using Aspose.Email for Java 20.2 on my end. For your kind reference, I have attached the EML file as well as snapshot.

TestCalEml.zip (1.1 KB)

image.png (78.6 KB)

Hi Mudassir
Just tested using the latest Aspose.Email 20.2, and the issue was gone.
I could be testing using an old version.
thanks,

@curtisyamada,

It’s good to know things are resolved on your end after using latest version.