Internet Direct (Indy) Version 9.0.2 Beta
TIdIMAP4.GetLineResponse
Retrieves and Checks an IMAP4 server response line.

function GetLineResponse(const ATag: String; const AAllowedResponses: array of SmallInt): SmallInt; virtual; overload;
Parameters
const ATag: String
Command tag name expected in the response.

const AAllowedResponses: array of SmallInt
Response codes allowed.

Returns
SmallInt - Response code from the server.

Description
GetLineResponse is an overloaded SmallInt function in TIdIMAP4 that retrieves an IMAP4 server response line, and determines the response code based on the tagged or untagged response content. Untagged response codes, indicated by "*" in the initial position of the response, always set the return value to True. Otherwise, the command tag name in ATag is expected in the server response, and the return value is based on the presence of "OK", "NO", or "BAD" in the response line.

GetLineResponse clears the contents of CmdResultDetails prior to retreiving a response line from the server using the ReadLnWait method, and adding the line to CmdResultDetails.

When the response line is an untagged server response, the ResultNo property is set to wsOk. When a tagged response is retrieved, the tag name in ATag is expected in the response, and the ResultNo value is determined by examing the reponse line.

GetLineResponse calls the inherited CheckResponse method, and sets the return value to the ResultNo from CheckResponse.