pre-define or alter list of IMAP keywords

spi spi at
Thu Aug 11 07:23:28 UTC 2022

Am 08.08.22 um 11:57 schrieb spi:
> I am using Dovecot with sdbox and mostly Thunderbird on Linux
> and FairEmail on Android as IMAP clients.
> I use a defined set of IMAP keywords to allow different users to mark
> and filter their mails based on keywords. That works pretty well but I
> stumble across an issue from time to time:
> In TB I can pre-define a list of keywords which the user can choose
> one from.
> FairEmail shows all those keywords Dovecot presents - there is nothing
> like the list in TB.
> Issue 1: If there are no mails flagged in a folder, Dovecot doesn't
> present any keywords and therefore FairEmail shows none - the user has
> to remember and type in the correct keyword.
> Issue 2: After some time FairEmail shows a huge list of keywords for
> the INBOX, even keywords not in use for quite some time. To get rid of
> these keywords I deleted the index files on Dovecot (which with sdbox
> are not meant to be deleted?). It seems, Dovecot caches the keywords
> in the index files.
> Question:
> 1) Is there a way on Dovecot to define a list of keywords Dovecot
> presents to the IMAP clients?
> 2) If not, is there a nicer way to clean the keyword lists from old
> entries not assigned to any mail in that folder?
I couldn't find any way to pre-define the list of keywords in dovecot so
far. The issue here seems also, that dovecot sends a list of keywords
after a 'select mailbox' based on what it finds in the index file. And
in my case sometimes the keyword list in the index file differs from the
keywords set in the respective mailbox' mails.

If there is no way to alter this list of keywords - is there any API or
script interface (like lua) with which one could alter the IMAP
responses dovecot is sending? For a selcet inbox the server answers with
FLAGS and PERMANENTFLAGS - might there be a way to alter the


b select inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)]
Flags permitted.


More information about the dovecot mailing list