Error: The operation 'CAPABILITY' terminated


#1

Hello,

We are seeing below error frequently (at least few times in a day) when we reading the mails.

The operation ‘CAPABILITY’ terminated. Timeout ‘100000’ has been reached.-The operation ‘CAPABILITY’ terminated. Timeout ‘100000’ has been reached.

Stack Trace:
at Aspose.Email.Clients.Imap.ImapClient.BeginSelectFolder(IConnection connection, String folderName, Boolean readOnly, AsyncCallback callback, Object state) at Aspose.Email.Clients.Imap.ImapClient.SelectFolder(IConnection iConnection, String folderName, Boolean readOnly) at Aspose.Email.Clients.Imap.ImapClient.SelectFolder(String folderName)

Can you please suggest what needs to be done to fix it?


#2

@srinudhulipalla,

Can you please share source files along with sample code so that we may further investigate to help you out.


#3

This is the code I use and it works all the times, suddenly the above mentioned error comes up. Is there limit in processing the number of emails?

        License license = new License();
        license.SetLicense("Aspose.Total.lic");
		
		ImapClient oClient = new ImapClient();
        oClient.Host = oRow["SMTPSERVER"].ToString().Trim();
        oClient.Username = oRow["USERNAME"].ToString().Trim();
        oClient.Password = oRow["USERPASS"].ToString().Trim();
        oClient.Port = Convert.ToInt32(oRow["SMTPPORT"].ToString().Trim());
        bool bSSLEnabled = Convert.ToBoolean(oRow["ENABLED"].ToString().Trim());
        if (bSSLEnabled)
        {
           oClient.SecurityOptions = SecurityOptions.Auto;
        }

        oClient.SelectFolder(ImapFolderInfo.InBox);

        ImapQueryBuilder builder = new ImapQueryBuilder();

        builder.HasNoFlags(ImapMessageFlags.IsRead);

        MailQuery oQuery = builder.GetQuery();

        ImapMessageInfoCollection messageInfoCol = oClient.ListMessages(oQuery);
		
		for (int i = 0; i < messageInfoCol.Count; i++)
		{
			MailMessage oMsg = oClient.FetchMessage(messageInfoCol[i].UniqueId);
			
			//save oMsg object details to DB
		}

#4

@srinudhulipalla,

I have observed the issue shared. We are internally working over it and will get back to you with feedback as soon as possible.


#5

@srinudhulipalla,

I suggest you to please try setting Timeout property to some large value or -1 on your end. I also suggest you to please share a test account reproducing issue on your end as well, so that we may further verify issue on our end.


#6

Is the Timeout link mentioned in above post valid? I couldn’t able to access it.


#7

@srinudhulipalla,

Yes, this link is valid and i am able to access this. can you pleas share what kind of problem you are facing when you tried to access this.


#8

I can able to access it today, I was getting 404 page error yesterday. Thank you.

“Timeout value can not be less then value of NetworkTimeout property”

What is the meaning of above statement wrt. NetworkTimeout?


#9

@srinudhulipalla,

It’s good to know things are fine on your end.

I have shared the solution with you already for setting the TimeOut value in my previous post as well.


#10

I understand.

I have given the Timeout is -1.

But the below link says the property description as “Gets or sets the timeout for mail operations Please note: Timeout value can not be less then value of NetworkTimeout property”

I was trying to understand the part “Timeout value can not be less then value of NetworkTimeout property”. Can you please explain?

https://apireference.aspose.com/net/email/aspose.email.clients/emailclient/properties/timeout


#11

@srinudhulipalla,

Please disregard this information as its obsolete. We will be removing this in next version too.