Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Support for Zimbra tags

#1542

Context:
* I'm using Zimbra as my e-mail infrastructure (8.6.x as of now). * I'd like to use Zimbra's tag functionality to label and organise my e-mails.

Problem:
* Mailmate can't identify the Zimbra tags. Presumably because Zimbra uses some proprietary way to handle tags. * The tags from Zimbra can be discovered through "RAW Flags" in Mailmate, which shows for example: "\Recent \Seen \MyTag1:FLAG661007". MyTag1 is the tag I'd like to make use of in Mailmate.

Question:
* Is there a way that Zimbra and Mailmate can sync tags?

Reported by Spot · October 2nd, 2016 @ 09:01 AM

State: new
Milestone: none
Assigned to: benny benny

Activity

  1. benny
    benny

    Well, in theory you should be able to go to the Tags preferences pane in MailMate and bind a tag named, e.g., “MyTag” to the IMAP keyword \MyTag1:FLAG661007. The IMAP keyword is a bit unusual, but maybe Zimbra needs them to be globally unique or something like that.

    (I didn't know Zimbra could do this and I don't know if any MailMate users utilize it.)

    October 3rd, 2016 @ 02:02 PM

  2. Spot
    Spot

    Good point. I'll give tag binding a try!

    October 3rd, 2016 @ 02:25 PM

  3. Spot
    Spot

    I managed to bind the IMAP keywords.

    One question (or issue) remains: If I tag a message, Mailmate won't sync back the tags to Zimbra. I couldn't really figure out a reproduction path, but what I can observe is that Mailmate (or Zimbra) messes up with the "\" before the IMAP keyword. I think Zimbra doesn't set them while Mailmate (correctly) sets them. This way you'll end up with something like "\Recent \Seen MyTag1 \MyTag1". Does my explanation make sense?

    October 7th, 2016 @ 04:12 PM

  4. benny
    benny

    Hmm, I'm not sure about that explanation. You can try this:

    • Open the Activity Viewer (⌥⌘0).
    • Set a tag server side and wait for it to sync with MailMate.
    • Set a tag in MailMate and wait for it to sync with Zimbra (or not sync).
    • Use “Help ▸ Send Server Logs”.

    Then I can see if there's anything suspicious in the logs.

    October 11th, 2016 @ 01:06 PM

  5. Spot
    Spot

    The interesting part is that my flag "URGENT" works without any issue, while my other flags like "DESIGN" don't, for no apparent reason. I just sent you my server log via e-mail.

    October 23rd, 2016 @ 08:24 PM

  6. benny
    benny

    I can confirm that URGENT seems fine in your logs, but I don't see any attempts to set any other keywords. (Note that logging is only enabled while the Activity Viewer is open.)

    Maybe try another set of logs where you try more actions. Also try taking the account offline/online while logging since this'll allow me to see what the server tells MailMate about what is possible (what kind of flags are allowed).

    October 24th, 2016 @ 11:33 AM

  7. Spot
    Spot

    Sure, I just sent you another log.

    October 24th, 2016 @ 01:55 PM

  8. benny
    benny

    Thanks. I can only see that you tried to disable the DESIGN tag from MailMate, but I can also see some interesting things about TECHNEWS.

    It appears that the server tells MailMate that the following keywords are allowed:

    S: * FLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded $MDNSent Forwarded $Junk $NotJunk Junk JunkRecorded NonJunk NotJunk DESIGN TECHNEWS)
    

    This line also tells MailMate that it cannot create any new keywords. This indicates that new tags can only be created server-side. It's also possible that MailMate might not always pick up changes to the set of allowed keywords since this is not a common scenario.

    If you create, e.g., TECHNEWS server side, are you then still unable to use MailMate to set this tag on a message (in the same mailbox)?

    October 24th, 2016 @ 07:51 PM

  9. Spot
    Spot

    Now it's getting interesting! Yes, if I've set TECHNEWS server-side beforehand, I'm then able to set this tag on a message within Mailmate and it syncs its state properly with the server.

    October 24th, 2016 @ 08:38 PM

  10. benny
    benny
    • State changed from new to resolved

    Ok, if you don't think anything else is misbehaving then I'll close the ticket. MailMate cannot create new tags client-side and there's not really anything I can do about it.

    (It's possible that even though the server reports that MailMate cannot create new keywords that it still might allow it in practice.)

    October 25th, 2016 @ 12:40 PM

  11. Spot
    Spot

    I'd love if we could investigate one step deeper. We narrowed down the situation to the following problem:

    Even if the tags are created on the server, I need to set the tag of an e-mail on the server-side first to allow it to be removed/ re-added client-side in Mailmate. I could imagine that URGENT works without issues because it already exists as a standard tag. But any other, custom tag (like DESIGN or TECHNEWS) generates the aforementioned issue.

    October 25th, 2016 @ 01:36 PM

  12. benny
    benny

    You can try the following manually in a Terminal window:

    telnet zimbra.webstyle.ch 143
    

    Then login:

    0 LOGIN username password
    

    Then select a mailbox:

    0 SELECT INBOX
    

    List its messages:

    0 FETCH 1:* (UID FLAGS)
    

    Finally, try setting a non-existing keyword (replace 12345 with a valid UID in the list returned above):

    0 UID STORE 12345 +FLAGS (DUMMY)
    

    Now, see if this last action is successful despite the non-existence of the keyword. If this works then I could add an option to ignore that the server tells MailMate that this is not possible.

    October 27th, 2016 @ 10:07 AM

  13. Spot
    Spot

    The last action was successful and also re-listed the messages to be sure: The non-existing tag was successfully added despite its non-existence.

    October 29th, 2016 @ 05:44 PM

  14. benny
    benny

    Ok, try this. Edit this file:

    ~/Library/Application Support/MailMate/Sources.plist
    

    Add ignorePermanentFlags = 1; to the Zimbra account and save the file.

    Hold down ⌥ when clicking “Check Now” in the Software Update preferences pane (r5296).

    This should make MailMate ignore the PERMANENTFLAGS response in the sense that MailMate assumes the server allows the creation of new IMAP keywords.

    November 2nd, 2016 @ 02:24 PM

  15. Spot
    Spot

    Awesome. I successfully applied the update. I still have some sync issues, but I'll have to observe a bit longer to figure out a patterns. Will come back with more insights!

    November 2nd, 2016 @ 03:06 PM

  16. benny
    benny

    Ok, I didn't really test the workaround (not having a Zimbra account or something similar) and it's possible that I failed to implement it correctly.

    It's also possible that the Zimbra server does not always allow the implicit creation of IMAP keywords.

    November 2nd, 2016 @ 03:07 PM

  17. Spot
    Spot

    After a few tests, the situation is actually a bit weirder. In the sense of less reproducible:
    * The existing tag DESIGN syncs perfectly client- and server-side. * The existing tag TECHNEWS doesn't sync at all. * The existing tag URGENT doesn't sync at all. * The new client-side tag DONOW is not created on the server-side. Can't really see a pattern yet. At least the tags DESIGN and TECHNEWS/ URGENT should have the exact same behaviour.

    November 5th, 2016 @ 05:23 PM

  18. benny
    benny

    Well, I guess we are at a dead end then unless this somehow means the workaround is not doing as advertised.

    November 5th, 2016 @ 08:25 PM

  19. Spot
    Spot

    Looks like Zimbra is pretty buggy in this regard :/ Just curious: Are you aware of any open-source e-mail servers that fully support IMAP keywords?

    November 5th, 2016 @ 08:34 PM

  20. benny
    benny

    My personal favorite is Dovecot.

    November 6th, 2016 @ 03:07 PM

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.