Retrieves and checks a multiple line IMAP4 server response.
function GetResponse: string; overload; reintroduce;
String - The initial word from the server response.
GetResponse is a reintroduced string function in TIdIMAP4 that implements retrieval and processing of IMAP4 server responses. GetResponse is used to read and accumulate response lines from the remote IMAP4 server until a line that has a valid response that terminates the response.
GetResponse handles server response that include the following:
C41 OK Completed
* LIST (UnMarked) "/" INBOX * LIST (UnMarked) "/" Junk * LIST (UnMarked) "/" Junk/Subbox1 C42 OK Completed
* OK CommuniGate Pro IMAP Server 3.5.7 ready
+ Send the additional command text
OK - search completed NO - search error: can't search that [CHARSET] or criteria BAD - command unknown or arguments invalid
Because you may get data first, which you need to skip, you need to accept all the above possibilities.
We MUST stop when we find a valid response code, like OK.
GetResponse sets the formatted reply in LastCmdResult using the initial tagged or completion response accumulated from the server.
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.