First of all, there is a mistake on line 115

  imap_delete($connection, $headerinfo>Msgno);

should read

  imap_delete($connection, $headerinfo->Msgno);

I found out on my configuration that $headerinfo->Msgno is a string(4), which causes the imap_delete($connection, $headerinfo>Msgno);
to fail and mark deleted the first mail all the time.
the correct code should be

imap_delete($connection, (int)$headerinfo->Msgno);

Comments

robert castelo’s picture

Status: Active » Fixed

Thanks, fixed in 6.x-2.1.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.