Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix in ListMailboxes call #330

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Lib/Protocols/IdIMAP4.pas
Original file line number Diff line number Diff line change
Expand Up @@ -6293,6 +6293,7 @@ procedure TIdIMAP4.ParseListResult(AMBList: TStrings; ACmdResultDetails: TString

procedure TIdIMAP4.InternalParseListResult(ACmd: string; AMBList: TStrings; ACmdResultDetails: TStrings);
var Ln : Integer;
LIdx : Integer;
LSlRetrieve : TStringList;
LStr : String;
LWord: string;
Expand All @@ -6319,15 +6320,17 @@ procedure TIdIMAP4.InternalParseListResult(ACmd: string; AMBList: TStrings; ACmd
//Make sure 1st word is LIST (may be an unsolicited response)...
if TextIsSame(LSlRetrieve[0], {IMAP4Commands[cmdList]} ACmd) then begin
{Get the mailbox separator...}
LWord := Trim(LSlRetrieve[LSlRetrieve.Count-2]);
LWord := Trim(LSlRetrieve[2]);
if TextIsSame(LWord, 'NIL') or (LWord = '') then begin {Do not Localize}
FMailBoxSeparator := #0;
end else begin
FMailBoxSeparator := LWord[1];
end;
{Now get the mailbox name...}
LWord := Trim(LSlRetrieve[LSlRetrieve.Count-1]);
AMBList.Add(DoMUTFDecode(LWord));
LWord := LSlRetrieve[3];
for LIdx := 4 to LSlRetrieve.Count - 1 do
LWord := LWord + ' ' + LSlRetrieve[LIdx];
AMBList.Add(DoMUTFDecode(LWord));
end;
end;
end;
Expand Down