IMAP connection with a Lotus-Domino Server throws AsposeException

Hi,

a customer of us cannot connect with its provider via IMAP. The customer gets the following AsposeException:

Kendox MailArchiver Configurator: AsposeException: Der Index und die Länge müssen sich auf eine Position in der Zeichenfolge beziehen.
00000004 4.17547750 [2740] Parametername: length
00000005 4.17547750 [2740] —> AsposeException: Der Index und die Länge müssen sich auf eine Position in der Zeichenfolge beziehen.
00000006 4.17547750 [2740] Parametername: length
00000007 4.17547750 [2740] —> AsposeException: Der Index und die Länge müssen sich auf eine Position in der Zeichenfolge beziehen.
00000008 4.17547750 [2740] Parametername: length
00000009 4.17547750 [2740] —> System.ArgumentOutOfRangeException: Der Index und die Länge müssen sich auf eine Position in der Zeichenfolge beziehen.
00000010 4.17547750 [2740] Parametername: length
00000011 4.17547750 [2740] bei System.String.Substring(Int32 startIndex, Int32 length)
00000012 4.17547750 [2740] bei #=zIL2um4DzBNodeI$sAT7a5FBcCBP_BqKlWy4g8XWled0b.get_Current()
00000013 4.17547750 [2740] bei #=zNr5PMnVMYsM$X_CoZV3xSY86XsLCLKEm8w==.#=z6RUhfTYCLBkR()
00000014 4.17547750 [2740] bei #=zt1DSLG4wxZThpcaXylLpOSYZkFApWm_68h2gdCk=.#=zXodT0eQ=(Object #=zS2$ZWos=)
00000015 4.17547750 [2740] — End of inner exception stack trace —
00000016 4.17547750 [2740] bei #=zy5UrRif1CVS62l3B9jNleZYEFl4C.#=zz_wK5fY=(IAsyncResult #=zZSqHyQI=)
00000017 4.17547750 [2740] bei #=zy5UrRif1CVS62l3B9jNleZYEFl4C.#=zz96JcTY=()
00000018 4.17547750 [2740] bei #=z0zQvslSB_C_S8zb048camOpFtv2abYQPfgnTJw4=.#=zTzyv6kSOfXv$o1S59Q==()
00000019 4.17547750 [2740] bei #=z0zQvslSB_C_S8zb048camOpFtv2abYQPfgnTJw4=.#=zIifMaoZVQhB8(String #=zm1mpb$4=, Int32 #=zd8llfjY=)
00000020 4.17547750 [2740] — End of inner exception stack trace —
00000021 4.17547750 [2740] bei #=z0zQvslSB_C_S8zb048camOpFtv2abYQPfgnTJw4=.#=zIifMaoZVQhB8(String #=zm1mpb$4=, Int32 #=zd8llfjY=)
00000022 4.17547750 [2740] bei #=z0zQvslSB_C_S8zb048camOpFtv2abYQPfgnTJw4=.#=zI_0vkjM=()
00000023 4.17547750 [2740] bei #=zaeIKp2VOOXpew6UnEj0KJkY9HcS5s_VBgw==.#=zvta8kTpJJ25b()
00000024 4.17547750 [2740] — End of inner exception stack trace —
00000025 4.17547750 [2740] bei #=zy5UrRif1CVS62l3B9jNleZYEFl4C.#=zz_wK5fY=(IAsyncResult #=zZSqHyQI=)
00000026 4.17547750 [2740] bei #=zy5UrRif1CVS62l3B9jNleZYEFl4C.#=zz96JcTY=()
00000027 4.17547750 [2740] bei #=zD9RZf4AiL6kAsxt6NbEPo$M1z2EA.#=zC7wqLxbG2A5d(Int32 #=zyRR2uIE=, #=zrHQ56MklVp4aqm0BhRpPV46L4zesyhp4EQ== #=zlocDVzU=)
00000028 4.17547750 [2740] bei #=zy5UrRif1CVS62l3B9jNleZYEFl4C.#=zc$h0AZD58Cdf()
00000029 4.17547750 [2740] bei #=zy5UrRif1CVS62l3B9jNleZYEFl4C.#=z0Fmyui8=(AsyncCallback #=zophO380=, Object #=zS2$ZWos=)
00000030 4.17547750 [2740] bei Aspose.Email.Clients.Imap.ImapClient.#=z83DPZFtiGk8L(IConnection #=zhquMbPY=, String #=zvz4Va5w=, AsyncCallback #=zophO380=, Object #=zS2$ZWos=)
00000031 4.17547750 [2740] bei Aspose.Email.Clients.Imap.ImapClient.GetFolderInfo(String folderName)
00000032 4.17547750 [2740] bei Com.Kendox.MailArchiver.Library.MailProviders.Imap.ImapMailProvider.Connect(String imapHostName, String mailBoxAddress, SecureString imapMailBoxPassword, Int32 imapPortNumber, Nullable1 imapSecurityOption, Boolean enableTrace) 00000033 4.17547750 [2740] bei Com.Kendox.MailArchiver.Library.MailProviders.Imap.ImapMailProvider.Connect(String imapHostName, String mailBoxAddress, SecureString imapMailBoxPassword, Int32 imapPortNumber, Nullable1 imapSecurityOption, Action`2 callback)

The customer uses the following to connect to IMAP:
IMAP Server: Lotus-Domino Server V 10.0.1 FP3
Aspose.Email.dll 21.1
Hostname: Can be delivered, if needed
Username: Can be delivered, if needed
Password: Can be delivered, if needed
Port: 143
SecurityOptions: None

My IMAP code:

using (ImapClient client = new ImapClient())
{
    client.Host = "xyz";
    client.Username = "   "; // E-Mailbox address
    client.Password = "     ";
    client.SecurityOptions = securityOptions;
                switch (securityOptions)
                {
                    case SecurityOptions.None:
                        {
                            **client.Port = 143;**
                            Assert.Throws(typeof(AsposeException), delegate()
                            {   // * CAPABILITY STARTTLS LOGINDISABLED
                                ImapFolderInfo folderInfo = client.GetFolderInfo(ImapFolderInfo.InBox);
                            });
                        }
                        break;
                    default:
                        {
                            client.Port = 993;
                            ImapFolderInfo folderInfo = client.GetFolderInfo(ImapFolderInfo.InBox);
                        }
                        break;
                }
            } 

Can you tell me what could be the cause of this exception?

If necessary, the customer can provide Aspose a test email account. If you need a test email account what information do you require?

@pfa,
Thank you for the issue description. I’ve logged the issue in our tracking system with ID EMAILNET-40212. Our development team will investigate this case. I will inform you about any progress. If we need the test account or more information, I will let you know.

@pfa,
Our development team investigated the issue. The exception is thrown because of an unexpected response from the server. We need more information to investigate the exception. It would be better to have hostname and credentials so we can reproduce the error locally and take a look at the response from the server.

Unfortunately, our customer does not want anymore to share his credentials for a test account. Therefore you can close this issue.

Thank you for the effort.

@pfa,
As another way, you could enable activity logging and share log files for us.
Please look at the next article: ImapClient Activity Logging.

Dear Aspose team. We have the same or a similar issue.
Attached the logfile.

Aspose.Email.IMAP_2021-5-7.log.7z (852 Bytes)

Does this help to reproduce the error?

@daniel.wittwer,
Welcome to our community! Thank you for your query. Could you share your stack trace for the error, please?

@Andrey_Potapov, here you go:

 ---> AsposeException: Index and length must refer to a location within the string.
Parameter name: length
 ---> System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
   at System.String.Substring(Int32 startIndex, Int32 length)
   at #=zmQPFVgzwENbcbDcXMi0e553fQ$a0A2fkMCvY9F4YWHdY.get_Current()
   at #=zEAjispJHtw2$AbIPOzxSkzZSJFRceQUTGw==.#=zqPhE9YuiG5lK()
   at #=zrtvNxFSxf9_ayKuS6Azg3KED7OX7Hr2UitvrZXc=.#=zrZbOiUo=(#=zjGCci_42h8eky_4YOxoqwrznycL2v7V_vJcjg44= #=zwrcDAEoZxOQukC5lTg==)
--- End of inner exception stack trace ---
   at #=z9iSzmGr8Rv2NoVfjwFPLBDnkweR5.#=zGRdyl88=(IAsyncResult #=zoiuWW04=)
   at #=z9iSzmGr8Rv2NoVfjwFPLBDnkweR5.#=zXYpRvxI=()
   at #=zUgwmh0g3e9xuq3IRMEHQodfs4UtmZwMQmjinjxs=.#=z1z5YNFG4zUriv$EU5g==()
   at #=zUgwmh0g3e9xuq3IRMEHQodfs4UtmZwMQmjinjxs=.#=zwe2V$ZQBQV7Tod6TRw==()
   at #=zUgwmh0g3e9xuq3IRMEHQodfs4UtmZwMQmjinjxs=.#=zuclXFyA=(String #=zY1ngovA=, Int32 #=zdSpAOUU=)
--- End of inner exception stack trace ---
   at #=zUgwmh0g3e9xuq3IRMEHQodfs4UtmZwMQmjinjxs=.#=zcLl$LsXtGRsn(String #=zY1ngovA=, Int32 #=zdSpAOUU=)
   at #=zUgwmh0g3e9xuq3IRMEHQodfs4UtmZwMQmjinjxs=.#=zQUUHDII=()
   at #=zQvzlN1iF9eZnhdI2jRMo$aF2GiXKdlJbLg==.#=zNk7I5RohgB1h()
--- End of inner exception stack trace ---
   at #=z9iSzmGr8Rv2NoVfjwFPLBDnkweR5.#=zGRdyl88=(IAsyncResult #=zoiuWW04=)
   at #=z9iSzmGr8Rv2NoVfjwFPLBDnkweR5.#=zXYpRvxI=()
   at #=z76UVwEl6EUxKI3G4KPy$FkyOmmQ81zHDxgv2Gs8=.#=zuqERXhM=(#=zz$BIg_POcfoAdK9ejQ4JlmbEH4kP$irlYA== #=za6XAuHA=)
   at #=zy5$uBOqOuLvKCL3rFvZyAxKmMA9f.#=zhFU5x44HEeRE(Int32 #=ziFh6J4s=, #=zz$BIg_POcfoAdK9ejQ4JlmbEH4kP$irlYA== #=zzrMQxkc=)
   at #=z9iSzmGr8Rv2NoVfjwFPLBDnkweR5.#=zVWRV$c8fMgBb()
   at #=z9iSzmGr8Rv2NoVfjwFPLBDnkweR5.#=zsMq4bDw=(AsyncCallback #=zPJDl$MQ=, Object #=z3r3LHIk=)
   at Aspose.Email.Clients.Imap.ImapClient.#=z3TpezQVYNWTr(IConnection #=zonhtzTM=, String #=zAWiujLsjxBdm, Boolean #=zhQsSIj_dHtq2, ListFoldersOptions #=zkN361gc=, ListFoldersReturnOptions #=zdiVLjj8BJj9K, AsyncCallback #=zPJDl$MQ=, Object #=z3r3LHIk=)
   at Aspose.Email.Clients.Imap.ImapClient.ListFolders()
   at XXX MyCode XXX

I tried different methods. Also the SelectFolder does not work.

@daniel.wittwer,
I passed your information about the issue to our development team. I will inform you about any progress.

The issues you have found earlier (filed as EMAILNET-40212) have been fixed in this update.