Getting an Error "Cannot send command to the server because the response for previous one was not received."

0 votes
asked Apr 1, 2015 by rockyshah2015 (750 points)

Hi Team,

I am using the REBEX trial version in my application. My Rebex based application is processing some email from multiple accounts on my mailing server but i am getting the below error.Please analyse the below error that my application has legged in the log file, and get me a permanent solution over this and also tell me what is the reason for me to get this error.I get this error not always but some times.

Error Log
--------------------------------------- Start Program 3/31/2015 8:48:13 PM ---------------------------------------

InnerException = No Inner Exception Found
Message = Cannot send command to the server because the response for previous one was not received.
Source : Rebex.Imap
StackTrace : at Rebex.Net.Imap.DU(String A, String B, Object[] C)
at Rebex.Net.Imap.CU(String A, Object[] B)
at Rebex.Net.Imap.OV(ImapMessageSet A, String B)
at Rebex.Net.Imap.CopyMessage(ImapMessageSet messageSet, String destinationFolder)
at Rebex.Net.Imap.CopyMessage(String uniqueId, String destinationFolder)
at IQEmailExtractor.Program.ConnectToEmailServer(List`1 objLstGenericInvoicesImport, String GroupID, StringBuilder strLogFileBuilder)
TargetSite : System.String DU(System.String, System.String, System.Object[])
HelpLink : No HelpLink Found

--------------------------------------- End Program 3/31/2015 8:48:13 PM ---------------------------------------

Applies to: Rebex Secure Mail
commented Apr 1, 2015 by Tomas Knopp (58,890 points)
Just to make sure, the Rebex log contains much more information. If you create a Rebex log using the Imap LogWriter property with the default LogLevel (i.e. LogLevel.Debug) , there will be logged the communication between your Imap server and Rebex Imap client. The portion that you posted above, is only a stack trace of the actual exception that was raised by the CopyMessage method in your program. To be able to tell more, we need to see the full log. See my answer below for explanation why you get the ImapException.

1 Answer

0 votes
answered Apr 1, 2015 by Tomas Knopp (58,890 points)

The exception ("Cannot send command to the server because the response for previous one was not received") is usually thrown when one operation fails (due to timeout or another serious problem) and throws an exception, but that exception is ignored and another operation (Imap.CopyMessage() in this case) is attempted. A communication log created using Imap object's LogWriter property should make it possible to tell what is going on - either add the log to your post or mail it to support@rebex.net for analysis.

...