1

I'm trying to flag message with the imap flag "\flagged". The problem is that not only the message I intended to mark gets flagged, but also all other messages which were sent from the same email address are also flagged.

For example, in my mailbox I have 10 messages from example@host.com. I want to mark only one of them as "flagged", so I get it's uid and send a request. But it marks all 10 messages. I want only that one with the specific uid.

I'm working with gmail account. When flagging messages in gmail's webmail itself, it marks only one message as intended, so it's not a weird feature from gmail itself.

The code I'm using is below. What's the problem?

$uids = new Horde_Imap_Client_Ids([1521]);//uid of message I want to mark as flagged

$options = [
    'uids' => $uids,
    'add' => ['\flagged'],
];

$Imap_Client_Socket->store('INBOX', $options);
user3702861
  • 747
  • 2
  • 8
  • 19

1 Answers1

0

Change your options to this

$options = [
  'ids' => $uids,
  'add' => [Horde_Imap_Client::FLAG_FLAGGED],
];

Notice how uids changed to ids. Also, I used the flag constant defined in Horde_Imap_Client instead.

Nico
  • 6,395
  • 4
  • 25
  • 34