Bug in IMAP4 ?

Giganews Newsgroups
Subject: Bug in IMAP4 ?
Posted by:  Feij√≥ (fei…@x.suply.com)
Date: Thu, 6 Apr 2006

the line # 5613 on IdIMAP4:

        if ((LWord[1] = '{') and (LWord[Length(LWord)] = '}')) then begin

raises this error:
Access violation at address 0066B4DE in module test.exe'. Read of address

I'm using this code:

  with IMAP4 do
            for i := 1 to MailBox.TotalMsgs do
              if not CheckMsgSeen(i) then

in the CheckMsgSeen function, the error shows up

I try to change to that:

                if RetrieveFlags(i, vFlag)
                  and not (mfSeen in vFlag)
                  and Retrieve(i, Msg) then

but got the same problem :(

Am I doing something wrong?