We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

FormatException occurs when converting a MailMessage containing an ICS attachment to a MapiMessage

  1. Is a fix available for the FormatException shown below?
  2. Are there other known issues or unsupported attached file types when converting a RFC822 message to a MapiMessage?

The following exception occurs when converting a MailMessage that has an attached ICS calendar event to a MapiMessage:
class com.aspose.email.system.exceptions.FormatException: Invalid format string
com.aspose.email.system.DateTime.a(Unknown Source)
com.aspose.email.system.DateTime.parseExact(Unknown Source)
com.aspose.email.system.DateTime.parseExact(Unknown Source)
com.aspose.email.CalendarDateTime.a(SourceFile:73)
com.aspose.email.CalendarDateTime.(SourceFile:203)
com.aspose.email.DateProperty.setValue(SourceFile:170)
com.aspose.email.DateTimeStartProperty.(SourceFile:65)
com.aspose.email.ami$p.a(SourceFile:200)
com.aspose.email.ami.a(SourceFile:1176)
com.aspose.email.CalendarPropertyCollection.a(SourceFile:239)
com.aspose.email.CalendarObject.b(SourceFile:380)
com.aspose.email.CalendarObject.a(SourceFile:283)
com.aspose.email.CalendarObject.a(SourceFile:252)
com.aspose.email.MapiMessage.d(SourceFile:2916)
com.aspose.email.MapiMessage.fromMailMessage(SourceFile:1508)

The content of the ICS attachment is as follows:
BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Tokyo Standard Time
BEGIN:STANDARD
DTSTART:17090201T000000
TZOFFSETFROM:+0900
TZOFFSETTO:+0900
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:17092001T000000
TZOFFSETFROM:+0900
TZOFFSETTO:+0900
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER;CN=“EXAMPLE,SAMPLE”:MAILTO:sample@example.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=example
example:MAILTO:sample@example.com
DESCRIPTION;LANGUAGE=ja-JP:これはテストメールです。\n\nスケ
ジューラの空きスケジュールを選択し送付\n\n
SUMMARY;LANGUAGE=ja-JP:空きスケジュールに登録
DTSTART;TZID=Tokyo Standard Time:20170920T200000
DTEND;TZID=Tokyo Standard Time:20170920T203000
UID:040000008200E00074C5B7101A82E00800000000C09E746BA165D101000000000000000
010000000A88E50DD78F07944A7CD6DA460C35AF2
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20170920T052724Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION;LANGUAGE=ja-JP:
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-OWNERAPPTID:543959008
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DISALLOW-COUNTER:FALSE
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
END:VALARM
END:VEVENT
END:CALENDAR

@markb5f0b,

Can you please confirm to us if the above ICS file opens in MS Outlook? We are unable to open it in MS Outlook. Also, please share the sampel code you are trying at your end for further investigation at our end.

Thank you for looking into this issue.

We are able open the sample ICS file in Microsoft Outlook 2013.

The attached zip file contains:

  • ConvertMessage.java
    sample source code.
    The program when compiled can be run passing a license file as the first argument and a message file as the second argument.
  • 1803121317330000075824.eml
    test message
  • Outlookスケジュール.jpg
    screenshot of MS Outlook with the calendar event displayed.
  • Outlookバージョン情報.PNG
    screenshot of MS Outlook version information

convertmessage.zip (75.9 KB)

@markb5f0b,

The issue has been logged as EMAILJAVA-34352 in our issue tracking system for further investigation. We’ll update you here once there is some update or a fix version available in this regard.

Thank you! Looking forward to hearing back from you.

Is there a list of file types that are known to be problematic? (My boss wants to know)

Best Regards,
Mark

@Engineer_MK8-17.3,

There is no list of problematic files as far as API functionality is concerned. Problems arise with specific files as in your case that we fix then in one of monthly releases.

@kashif.iqbal

That’s exactly what my boss wanted to know.

Thank you!

You are welcome and please feel free to write to us if you have any other query related to the API.

The issues you have found earlier (filed as EMAILJAVA-34352) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by kashif.iqbal

This issue was verified as fixed in the aspose-email-18.3-jdk16 release.

However, it has reappeared during testing of the aspose-email-18.10-jdk16 release.
Releases 18.8, 18.9 as well as the current release 18.12 have been checked and all exhibit the problem.

Here is the exception that is logged.

15-Jan-2019 16:32:51.713 SEVERE [pool-3-thread-1] jp.co.air.pst.PstFile.retrieveAddMessage Convert message MailMessage -> MapiMessage failed.
class com.aspose.email.system.exceptions.FormatException: Invalid format string
com.aspose.email.system.DateTime.a(Unknown Source)
com.aspose.email.system.DateTime.parseExact(Unknown Source)
com.aspose.email.system.DateTime.parseExact(Unknown Source)
com.aspose.email.fu.a(SourceFile:72)
com.aspose.email.fu.<init>(SourceFile:155)
com.aspose.email.ky.a(SourceFile:146)
com.aspose.email.lg.<init>(SourceFile:56)
com.aspose.email.aoy$p.a(SourceFile:203)
com.aspose.email.aoy.a(SourceFile:1185)
com.aspose.email.gf.a(SourceFile:225)
com.aspose.email.ga.b(SourceFile:312)
com.aspose.email.ga.a(SourceFile:251)
com.aspose.email.ga.a(SourceFile:236)
com.aspose.email.MapiMessage.d(SourceFile:2867)
com.aspose.email.MapiMessage.fromMailMessage(SourceFile:1504)
jp.co.air.pst.PstFile.retrieveAddMessage(PstFile.java:484)
jp.co.air.pst.PstFile.access$400(PstFile.java:44)
jp.co.air.pst.PstFile$1.run(PstFile.java:384)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
    at com.aspose.email.system.DateTime.a(Unknown Source)
    at com.aspose.email.system.DateTime.parseExact(Unknown Source)
    at com.aspose.email.system.DateTime.parseExact(Unknown Source)
    at com.aspose.email.fu.a(SourceFile:72)
    at com.aspose.email.fu.<init>(SourceFile:155)
    at com.aspose.email.ky.a(SourceFile:146)
    at com.aspose.email.lg.<init>(SourceFile:56)
    at com.aspose.email.aoy$p.a(SourceFile:203)
    at com.aspose.email.aoy.a(SourceFile:1185)
    at com.aspose.email.gf.a(SourceFile:225)
    at com.aspose.email.ga.b(SourceFile:312)
    at com.aspose.email.ga.a(SourceFile:251)
    at com.aspose.email.ga.a(SourceFile:236)
    at com.aspose.email.MapiMessage.d(SourceFile:2867)
    at com.aspose.email.MapiMessage.fromMailMessage(SourceFile:1504)
    at jp.co.air.pst.PstFile.retrieveAddMessage(PstFile.java:484)
    at jp.co.air.pst.PstFile.access$400(PstFile.java:44)
    at jp.co.air.pst.PstFile$1.run(PstFile.java:384)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

This is the calendar that was attached to the message.

BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Tokyo Standard Time
BEGIN:STANDARD
DTSTART:17090201T000000
TZOFFSETFROM:+0900
TZOFFSETTO:+0900
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:17092001T000000
TZOFFSETFROM:+0900
TZOFFSETTO:+0900
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER;CN="EXAMPLE,TEST":MAILTO:test@example.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=example
    test:MAILTO:test@example.com
DESCRIPTION;LANGUAGE=ja-JP:これはテストメールです。\n\nスケ
    ジューラの空きスケジュールを選択し送付\n\n
SUMMARY;LANGUAGE=ja-JP:空きスケジュールに登録
DTSTART;TZID=Tokyo Standard Time:20170920T200000
DTEND;TZID=Tokyo Standard Time:20170920T203000
UID:040000008200E00074C5B7101A82E00800000000C09E746BA165D101000000000000000
     010000000A88E50DD78F07944A7CD6DA460C35AF2
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20170920T052724Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION;LANGUAGE=ja-JP:
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-OWNERAPPTID:543959008
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DISALLOW-COUNTER:FALSE
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
END:VALARM
END:VEVENT
END:VCALENDAR

@Engineer_MK8-17.3,

Thank you for your feedback.

We used the test message that you shared earlier and were able to reproduce the issue using the latest version of Aspose.Email API. We have logged a ticket in our issue tracking system as EMAILJAVA-34479 to investigate this scenario further. We will update you here as soon as additional information is available regarding this.

@muhammadahmad, Thank you for looking into this.

The issues you have found earlier (filed as EMAILJAVA-34479) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by muhammadahmad