Shared Tags

Post feedback about our hosted demo or your local install. Tell us what you love and/or what you’d like to see added in the future.
Post Reply
Brent-TCT
Posts: 6
Joined: Wed Jul 24, 2019 4:26 pm

Shared Tags

Post by Brent-TCT »

I have 8 users that were previously access a single account using a shared password. I finally put a stop to that and made the account a shared account. Unfortunately, they were using tags to delegate who was working on what. The tags apparently did not propagate to the shared folder and the users are having a mental meltdown.

Is there a way to make the tags shared, or an alternative?
Klug
Ambassador
Ambassador
Posts: 2955
Joined: Mon Dec 16, 2013 11:35 am
Location: France - Drôme
ZCS/ZD Version: All of them
Contact:

Re: Shared Tags

Post by Klug »

AFAIR, every users (and the shared account) must have created the _same_ tags in the _same_order so it works between mailboxes.
Internally the tags are handled by their ID if you want them to be "shared", they should have the same ID everywhere.
Brent-TCT
Posts: 6
Joined: Wed Jul 24, 2019 4:26 pm

Re: Shared Tags

Post by Brent-TCT »

I wanted to post a reply here to document what I found.

Shared Tags CAN work. Tags are stored as IMAP keywords within the message metadata. The tags use the tag name rather than the tag ID. So as long as all users have tags with exactly the same name, tags will sync between all users sharing a folder.

I also learned that creating the tags from the command line for each user creates them all with the color orange for some reason. The zmmailbox ModifyTagColor command didn't seem to work. I had to use the zmsoap command to fix the tag colors.

This is the script I ended up using to fix the tag colors:

Code: Select all

#!/bin/bash
USERS=(
user1@domain.com
user2@domain.com
user3@domain.com
user4@domain.com
)

set_tag_color() {
  local USER="$1"
  local TAG="$2"
  local ATTR="$3"

  local ID
  ID=$(zmsoap -z -m "$USER" GetTagRequest 2>/dev/null \
    | sed -n "s/.*<tag .*name=\"$TAG\" id=\"\([^\"]*\)\".*/\1/p")

  if [ -z "$ID" ]; then
    echo "  ERROR: tag '$TAG' not found for $USER"
    return 1
  fi

  echo "  $TAG -> $ATTR"
  zmsoap -z -m "$USER" TagActionRequest/action @op=color @id="$ID" $ATTR >/dev/null
}

for USER in "${USERS[@]}"; do
  echo "Fixing tag colors for $USER"

  set_tag_color "$USER" "Tag1" "@color=9"
  set_tag_color "$USER" "Tag2" "@rgb=#CC33CC"
  set_tag_color "$USER" "Tag3" "@color=5"
  set_tag_color "$USER" "Tag4" "@rgb=#FF6600"
  echo
done
User avatar
wentum
Advanced member
Advanced member
Posts: 59
Joined: Fri Apr 04, 2014 10:49 am
Location: Pforzheim (Germany)
ZCS/ZD Version: Release 10.1.10.GA.4655
Contact:

Re: Shared Tags

Post by wentum »

Hello Brent-TCT,

could you please tell us what document you referred to?
I'm eger to learn everything about those tags because it has been a long time pain for me:

I often do migrations using imapsync (between zimbras...) and sometimes I just can generate same tags at target and it works but sometimes it doesn't (don't know completely why...)!
But what I found out is that some special characters seem to prevent imapsync to synchronize correctly. So these tags are gone at target anyway.
If you rename those tags including special characters before (imap)syncing it to target chances are better to get someting usable at target...

All in all I really hate it, but unfortunately many users seem to love it... ;-)

Regards
Joerg
Klug
Ambassador
Ambassador
Posts: 2955
Joined: Mon Dec 16, 2013 11:35 am
Location: France - Drôme
ZCS/ZD Version: All of them
Contact:

Re: Shared Tags

Post by Klug »

ZImbra allows spaces (and accented characters) in the tags while IMAP standard doesn't.
So when using a "true" IMAP client (such as IMAPsync), you cannot download (sync) mails that are tagged with such tags (spaces and/or accents).
You need to fix the tags first (replace spaces and accented characters).

There are also an issue with some clients (Outlook using IMAP? I'm not sure) that add some tags to mails that are not correctly handled by Zimbra (because the tags were not created in Zimbra?).
You don't see these tags in the webmail (in the tags list in the left margin) so you cannot select all mails with such tags in an easy way to fix them (ie: add a new tag then delete the old one).
You need to find a mail with such a tag (using IMAPsync log), the tag it will be showed in the webmail ; then by clicking on it you can select all mails with the tag (and fix it).

The worst with the second issue is that you cannot fix if using CLI because Zimbra doen't know about the tag (in the tags list), you cannot select by this tag.
So, AFAIK, you have to fix it manually (in the webmail).
User avatar
JDunphy
Elite member
Elite member
Posts: 1008
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC

Re: Shared Tags

Post by JDunphy »

FWIW, I researched tags 6 months ago with GPT 5.2 extra reasoning trying to understand how Zimbra and tags work when I was playing with imapsync. My notes:

https://github.com/JimDunphy/Stalwart-T ... P_NOTES.md

I have not revisited the document for hallucinations but the above concepts were good enough for a python script to generate real-world account migration data for another project I had been working on attempting to understand JMAP, JMAP PUSH using the Zimbra Web Client (ZWC).

I also thought there were some explanations in the wiki.zimbra.com for tags, imapsync, and imap but I am coming up short looking for them now.

Jim
Post Reply