#3315 new
Hans Tammen

Tags not accepted

Reported by Hans Tammen | January 21st, 2024 @ 03:31 AM


Mailmate does not accept tags anymore, I get the error message "too many user flags in mailbox". In fact, right now I have only 14 messages tagged with exactly three different tags. Why these three I have no idea.

Any ideas what I should look for?


Comments and changes to this ticket

  • benny

    benny January 22nd, 2024 @ 03:07 PM

    It looks like your IMAP server has a limit on the maximum number of IMAP keywords used. This is unfortunately not something MailMate can ask the server about (there's no interface to do so). MailMate just assumes it's possible to create another one when needed -- and then it might fail.

    To learn more you can enable the “Raw Flags” column in the message list of MailMate. This will show you the exact set of IMAP keywords currently set for a given message. Also note that the Tags preferences pane show you the tag names (display names) MailMate has assigned to such an IMAP keyword.

    Also, if you review the output in the Activity Viewer (Window menu of MailMate) you might be able to see the IMAP keywords currently in use for a given mailbox when MailMate connects to the mailbox. I think it's possible that the limit on IMAP keywords is per mailbox and not per account, but I'm not sure about that -- again, it'll depend on the IMAP server implementation.

    Finally, it'll also depend on the server to what extent it's possible to “release” an IMAP keyword, e.g., by untagging all messages using a specific IMAP keyword. If this is a problem then note that it's possible to reuse unused IMAP keywords simply by giving them a different Tag display name. For example, you could bind “MyCustomName” to \Seen and it would become a tag which has the same state as the standard one used for the unread state (the blue dot). (Might be confusing though, but it would work.)

  • Hans Tammen

    Hans Tammen January 22nd, 2024 @ 03:56 PM

    Here's what I found so far:
    1. Looking at the "raw flags", I see a varying number of flags per email. Regardless of the email having three flags ($X-ME-Annot-2 \Recent \Seen) or more, I cannot add any other tags than the three tags that are currently working.
    2. Those can be added to any email available. One of them is just a month old, the other two are several years old.
    3. I have regularly deleted unused tags in the preferences, right now there are only the three "allowed" tags visible.
    4. I've tried Postbox & Airmail in the past, their tagging system works, but they might handle tags in a different way. Also your Markdown implementation is exemplary, so I came back quickly. ;-)
    5. Do you think it makes sense to contact Fastmail, who is running the IMAP sevrer?
    6. Also, anybody else having that problem?
    Thanks, Hans

  • benny

    benny January 23rd, 2024 @ 08:26 AM

    Note that the preferences/settings pane in MailMate (Tags) is only to provide MailMate with a mapping from Tag names (display names) to server IMAP keywords. It does not change IMAP keywords or create/delete IMAP keywords on the server. There's no way to do that.

    When the server is asked to add an an unknown IMAP keyword to a message then it's implicitly created (in whatever way the server handles keywords). Some servers (Office365) do not support the creation at all. Some servers will hit a limit on the number of keywords because of some internal storage/implementation limit.

    This means that there's no explicit way to remove an IMAP keyword. One can only hope that removing an IMAP keyword from all messages using it will mean that it's implicitly removed from the set of existing IMAP keywords on the server.

    To give you a better view of what's currently in use in your account, we can push MailMate a bit on its more advanced features:

    • Select the “All Messages > All / Junk / Trash” mailbox. This is to ensure you see all emails in all accounts (assuming you don't have any unsubscribed mailboxes).
    • Enable the “Raw Flags” column just to keep it in mind and be able to verify its content.
    • Double-click the mailbox to edit its settings.
    • Go to the Submailboxes pane and enable the submailboxes feature using the “Tags/Keywords” header (this is essentially IMAP keywords).
    • Also enable the “Submailboxes for the messages of each account” setting in the same window.

    Now, look in the mailbox list and note how this mailbox has a submailbox for each account. Each of these will have a submailbox for each keyword in use in the account. Anything starting with $ or a backslash are reserved. You should not do anything with them.

    You might see keywords for which you do not have a tag (either because you deleted it or it was added by another email client). If you recreate a tag to match the keyword then you'll be able to remove it using the tagging interface of MailMate. Step by step:

    • Locate and select a mailbox with a keyword you would like to get rid of.
    • Go to the Settings > Tags pane in MailMate and create a tag with any name mapped to the exact keyword found in the first step.
    • Go back to the mailbox and select all emails.
    • Hit the 'T' key and put the tag name in the remove part (right hand side). (Hmm, I thought this had placeholder strings to clearly show the difference between left and right.)
    • Hit Enter.

    Now there are no messages using this IMAP keyword.

    This might release a slot for a new IMAP keyword on the server, but if it doesn't then you could just name the tag whatever you need it to be. It doesn't really matter what the name is on the server (other than in the now confusing Raw Flags column).

    Sorry about the many details, but I hope it'll lead to a better understanding of what's going on.

  • Alan Dobkin

    Alan Dobkin January 24th, 2024 @ 07:33 PM

    As usual, this is excellent detailed advice from Benny. And several great methods to troubleshoot the problem.

    Coincidentally, I ran into this problem myself a few months ago and did a bunch of research to troubleshoot. It turns out that Dovecot (one of the most popular IMAP servers) has a limitation of 26 flags when using the Maildir (default) storage format. Each mailbox has a different set of flags, so you can easily reset the flags by creating a new mailbox folder and moving all of your messages to it. According to their documentation:

    All the non-standard message flags are called keywords in IMAP. Some clients use these automatically for marking spam (eg. $Junk, $!NonJunk, $Spam, $!NonSpam keywords). Thunderbird uses labels which map to keywords $Label1, $Label2, etc.

    Dovecot stores keywords in the Maildir filename’s flags field using letters a..z. This means that only 26 keywords are possible to store in the Maildir. If more are used, they’re still stored in Dovecot’s index files. The mapping from single letters to keyword names is stored in dovecot-keywords file.


    Newer versions of Dovecot include a doveadm-flags command to manage (add, remove, or replace) flags:

  • Hans Tammen

    Hans Tammen January 30th, 2024 @ 03:10 AM

    Thanks for sending this, I was finally able to deal with it. While the troubleshooting methods did work fine, the result is baffling. So I can create submailboxes for the mailbox in question (and then also for a couple of others), the only submailboxes created - besides the $ and \ - were the 3 tags that I currently have anyway.

    Means I wasn't trying to delete or replace tags, as there weren't any besides my regular 3.

    Then I tried a previous tag that I remembered, and it worked. Now I have four, woohoo! ;-)))

    If I only could remember what I have used in the past, I deleted all unused tags in the preferences, as I thought that'll help.


  • benny

    benny February 1st, 2024 @ 11:39 AM

    @Alan: Thanks for looking that up.

    @Hans: You should perhaps try the Submailboxes trick on “All / Junk / Trash” to see all the raw IMAP keywords seen by MailMate. And try creating a new mailbox in the account to see if that works better.

    Also, if you have an older backup then you can see the Tags-mapping in this file:

    ~/Library/Application Support/MailMate/Tags.plist
  • Hans Tammen

    Hans Tammen February 1st, 2024 @ 07:24 PM

    Hi Benny,

    before we proceed, looking at the version I get this: "You are Using a Prerelease, 5673 is the latest version available. You have version 5937." Does it make a difference?

    In the "/ All / Junk / Deleted" I just see:
    \Flagged \Recent \Seen $CanUnsubscribe $IsMailingList $IsNotification $X-ME-Annot-2 Other [no idea what Other is, can't assign an Other tag]

    If I do the same on "All Message Subparts", I see a few more (e.g. $Phishing, and the few tags I created.

    As for making a mailbox, not sure how it works, as I can only see options for smart mailboxes?



  • Hans Tammen

    Hans Tammen February 1st, 2024 @ 08:18 PM

    also I forgot to mention, in ~/Library/Application Support/MailMate/Tags.plist I only see the few tags I'm working with, as I have deleted all other tags in the preferences a while ago. Hans

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Mac OS X email client.

Shared Ticket Bins

People watching this ticket