[RCD] How to query IMAP Flag from within a plugin?
benoit.panizzon at imp.ch
Mon Aug 14 08:33:18 CEST 2017
Thank you for your reply.
> It's probably worth to look a the thunderbird_labels plugin for
> Roundcube . It uses IMAP flags to store custom labels.
> Custom flags need to be supported by the IMAP server with the
> PERMANENTFLAGS capability. You can check this with the following
> command from within a plugin:
Thank you, Brendan already pointed out to me, that custom flags
retrieval support is built in in RC via list_flags function.
> $this->rc->storage->check_permflag('Junk') ||
> Then setting and unsetting those flags should be possible.
> In order to check a certain flag, you have to test it in the message
> object and not the IMAP storage instance in Roundcube. Do this in one
> of the message hooks like message_load  or messages_list :
> if (!empty($message->headers->flags['Junk']))
Yes I had a look at this function.
Unfortunately, as far as I have found out, custom flags are not returned
nor queried by the header->flags function. But list_flags looks
promising, my first test dumped all the custom flags of the messages
submitted to that function. Now I just have to build some logic around
to filter out the already reported (flagged as JUNK) messages from the
array the of msg_id's the customer is reporting. I suppose I will get
that done today :-)
I m p r o W a r e A G - Leiter Commerce Kunden
Zurlindenstrasse 29 Tel +41 61 826 93 00
CH-4133 Pratteln Fax +41 61 826 93 01
Schweiz Web http://www.imp.ch
More information about the dev