Skip to content
Advertisement

imap_setflag_full seems to do nothing?

I’m trying to flag a message as seen:

var_dump(imap_setflag_full($mail, "9", "\Seen", ST_UID));

The output is bool(true) but when I then re-fetch my messages (imap_fetch_overview) this is what I see:

object(stdClass)#4 (15) {
  ["subject"]=>
  string(3) "..."
  ["from"]=>
  string(47) "... <...@...>"
  ["to"]=>
  string(14) "...@..."
  ["date"]=>
  string(30) "Wed, 8 Dec 2021 12:04:59 +0200"
  ["message_id"]=>
  string(68) "<...>"
  ["size"]=>
  int(2580)
  ["uid"]=>
  int(9)
  ["msgno"]=>
  int(9)
  ["recent"]=>
  int(1)
  ["flagged"]=>
  int(0)
  ["answered"]=>
  int(0)
  ["deleted"]=>
  int(0)
  ["seen"]=>
  int(0)
  ["draft"]=>
  int(0)
  ["udate"]=>
  int(1638957899)
}

Clearly I’m doing something wrong, but I can’t spot what.

Advertisement

Answer

As written in the comments of imap_setflag_full, pop3 apparently does not support flags other than the deleted one. After switching to IMAP flags work as expected.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement