This project has moved and is read-only. For the latest updates, please go here.
1

Closed

Incorrect UIDNEXT after SELECT

description

After calling TIdIMAP4.SelectMailBox() the value of MailBox.UIDNext is incorrect. Example: After this client/server conversation: C: A142 SELECT INBOXS: * 172 EXISTSS: * 1 RECENTS: * OK [UNSEEN 12] Message 12 is first unseenS: * OK [UIDVALIDITY 3857529045] UIDs validS: * OK [UIDNEXT 4392] Predicted next UIDS: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)S: * OK [PERMANENTFLAGS (\Deleted \Seen *)] LimitedS: A142 OK [READ-WRITE] SELECT completed the resulting MailBox.UIDNext is '439' instead of '4392'. In IdIMAP4.pas, procedure TIdIMAP4.ParseSelectResult, line 4959 in the 2011-10-16 snapshot:  if Pos('[UIDNEXT', ACmdResultDetails[Ln]) > 0 then begin {Do not Localize} AMB.UIDNext := Trim(Copy(ACmdResultDetails[Ln], (Pos('[UIDNEXT', ACmdResultDetails[Ln]) + {Do not Localize} Length('[UIDNEXT')), {Do not Localize} (Pos(']', ACmdResultDetails[Ln]) - {Do not Localize} (Pos('[UIDNEXT', ACmdResultDetails[Ln]) + {Do not Localize} Length('[UIDNEXT')) - 1))); {Do not Localize} end; The "- 1" at the end causes the last character of the UIDNEXT response to be lost.
Closed Apr 6 at 1:25 AM by gambit47

comments

gambit47 wrote Dec 26, 2012 at 7:11 PM

Fixed in rev 4712

wrote Feb 13, 2013 at 11:09 PM

wrote May 16, 2013 at 6:14 AM

wrote May 16, 2013 at 6:14 AM

wrote Jun 14, 2013 at 8:50 AM

wrote Apr 6 at 1:25 AM