Aspose.Email Java and IPv6

Is using Aspose.Email Java in an IPv6 server supported?

Both IMAP and POP3 are having issues connecting to a mail server (GMail for testing) when the server is forced to use IPv6.

Pop3Client pop3Client = new Pop3Client(host, port, username, password);
pop3Client.setSecurityOptions(SecurityOptions.SSLImplicit);

int iMessageCount = pop3Client.getMessageCount();

pop3Client.getMessageCount();

This call will throw the exception when IPv6 is being used. (using this java argument Djava.net.preferIPv6Addresses=true )

The exception is this:

AsposeException: java.lang.NullPointerException
—> AsposeException: java.lang.NullPointerException
—> java.lang.ArrayStoreException: java.lang.NullPointerException
— End of inner exception stack trace —
[Ljava.lang.StackTraceElement;@42e63d59
— End of inner exception stack trace —
[Ljava.lang.StackTraceElement;@50cce637
at com.aspose.email.anl.a(SourceFile:193)
at com.aspose.email.ie.g(SourceFile:648)
at com.aspose.email.ie.B(SourceFile:584)
at com.aspose.email.ie.a(SourceFile:565)
at com.aspose.email.Pop3Client.beginGetMessageCount(SourceFile:1383)
at com.aspose.email.Pop3Client.getMessageCount(SourceFile:1498)
at com.aspose.email.Pop3Client.getMessageCount(SourceFile:1510)
at com.ricoh.mdm.mie.print.mail.server.POP3Server.proccessExistingMessages(POP3Server.java:44)
at com.ricoh.mdm.mie.print.mail.server.EmailServerUtils$1.run(EmailServerUtils.java:57)
at java.lang.Thread.run(Thread.java:748)
Caused by: AsposeException: java.lang.NullPointerException
—> java.lang.ArrayStoreException: java.lang.NullPointerException
— End of inner exception stack trace —
[Ljava.lang.StackTraceElement;@22757080
at com.aspose.email.anl.b(SourceFile:276)
at com.aspose.email.anl.a(SourceFile:23)
at com.aspose.email.anm.a(SourceFile:167)
at com.aspose.email.axx.a(SourceFile:193)
at com.aspose.email.internal.af.g.a(Unknown Source)
at com.aspose.email.internal.af.h.run(Unknown Source)
… 1 more
Caused by: java.lang.ArrayStoreException: java.lang.NullPointerException
at com.aspose.email.atl.a(SourceFile:329)
at com.aspose.email.atl.a(SourceFile:219)
at com.aspose.email.atl.a(SourceFile:159)
at com.aspose.email.fd.a(SourceFile:89)
at com.aspose.email.fd.a(SourceFile:75)
at com.aspose.email.ia.a(SourceFile:128)
at com.aspose.email.anl.a(SourceFile:293)
at com.aspose.email.anl.b(SourceFile:260)
… 6 more

Thanks for the help.

@matthewanselmo,

I have observed the issue shared by you. Can you please confirm if using IPv4 things are fine for IMAP or POP3 clients? Can you please try using latest Aspose.Email for Java 19.8 as well on your end.

When I remove this flag, Djava.net.preferIPv6Addresses=true, the code performs as expected.
This was tested with the latest version available to download, 19.7. I do not see a 19.8 version.

@matthewanselmo,

Thank you for sharing the feedback. An issue with ID EMAILJAVA-34579 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.