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

Free Support Forum - aspose.com

Receiving ImapException when connecting - Apose.Email Java

Receiving the below error on connection to an imap mailbox. I have tested connecting to the mailbox using telnet. No issues with telnet. Using version 6 for apose.email.

Any hints on how to debug this.

Thanks.

ImapException: AE0003 BAD Command Argument Error. 12
[Ljava.lang.StackTraceElement;@162e8784
at com.aspose.email.amf.f(SourceFile:52)
at com.aspose.email.xn.o(SourceFile:233)
at com.aspose.email.ce.a(SourceFile:241)
at com.aspose.email.internal.af.h.a(Unknown Source)
at com.aspose.email.internal.af.j.run(Unknown Source)
at java.lang.Thread.run(Thread.java:863)

@itmass.cna,

Thank you for writing to Aspose support team.

I have tested the scenario using latest version Aspose.Email for Java 17.7.0 and observed no issue as follows:

    ImapClient client = new ImapClient("mail.domain.com", 143);
    client.setSecurityOptions(SecurityOptions.Auto);
    client.setUsername("username");
    client.setPassword("password");
    ImapFolderInfoCollection coll = client.listFolders();

Could you please share the test account credentials on the said server so that issue can be observed here and assistance may be provided? We are sorry for the inconvenience caused to you in this regard.

Below is the code snippet that we using to list the messages in the folder. The error occurs when selectFolder method is called. Using Telnet, is there a way I can test the imap mailbox for any issue on the INBOX folder.

Thanks.

          imapClient.setSecurityOptions(SecurityOptions.Auto);
          imapClient.selectFolder(ImapFolderInfo.IN_BOX);
          ImapMessageInfoCollection co = imapClient.listMessages();
          Iterator<ImapMessageInfo> msgs =    co.iterator();

          Map<String,String> inboxMap = new HashMap<String, String>();

          while(msgs.hasNext()){
              ImapMessageInfo msg = msgs.next();
              inboxMap.put(msg.getMessageId(),msg.getUniqueId());
          }

@itmass.cna,

I have requested earlier to send us the credentials (user name and password) of some test account on the server which is causing this issue. It will help us to observe the problem and provide assistance. I am afraid that without re-producing the issue here, it is not possible to provide assistance.