I am loading the list of emails from Gmail with imap. The list of ids return, they are just listed like 1, 2, 3, even though I am using “SE_UID” which is supposed to return a proper unique id. $mailsIds = imap_search($this->getImapStream(), $criteria, SE_UID, $this->serverEncoding);
Also, moving the mail does nothing. I have tried $mailBox=“[Gmail]/Trash”, $mailBox=“[Gmail]/Starred”, etc. I have tried both with and without CP_UID.
and are you invoking imap_expunge to clean up after you’re done moving?
EDIT: I can read. derp.
Is getImapStream opening a new connection over and over? (My thoughts: If getImapStream is opening a new stream every time, then your expunge call isnt operating on the same thread as the move, which may be causing problems.)
Is there another reason imap_mail_move() would not work on Gmail? The $mailBox that I am trying is what I could find online for what should work for Gmail.
My suspicion was the $mailId was the issue as the ids returned didn’t look correct, but I could be way off. I’m getting the actual email contents fine, so who knows.