Cant sync emails

Looking to migrate to ZCS? Ask here. Got a great tip or script that helped you migrate? Post it here.
Post Reply
amaze646
Posts: 1
Joined: Fri Oct 14, 2022 6:00 pm

Cant sync emails

Post by amaze646 »

Hello,

I am in the process of migration of pretty old Zimbra to a new server which has the latest version of Zimbra. I migrated everything with this method. I migrated few servers with this method without any problems. But on this one I'm stucked :).

On old machine, I did archive of mail accounts with "

Code: Select all

zmmailbox -z -m info@mail.com getRestURL '/?fmt=tgz' > info\@mail.com.tgz
". Then I rsynced archive this on new server and use this to restore it

Code: Select all

zmmailbox -z -m info@mail.com postRestURL "/?fmt=tgz&resolve=skip" /backups/zmigrate/mailboxes/info@mail.com.tgz
. Mail is restored, so are contacts ... I can see folder structure in new webmail, all tags, messages ... But then there is problem when I try to imapsync this account - imapsync from old server to new one. There are few accounts only that are getting this error:

I get this:

Code: Select all

Err 35/50: Host2: flags msg INBOX/Done/149016 could not add flags [2WEDIDIT!od31do60min:FLAG3077381 Done \Answered \Flagged \Seen]: 87 NO UID STORE failed
Err 36/50: Host2: flags msg INBOX/Done/149310 could not add flags [7IMPROVEMENTod121sometag:FLAG3079385 Done \Answered \Flagged \Seen]: 88 NO UID STORE failed
...
All those flags are defined as tags on new server, and I can see them in webmail. So I can't synchronize these accounts with imapsync. I guessed that folder 88 nad 87 inside /opt/zimbra/store was missing. Some folders did missed. I create it and I get the same error.

Also, I noticed that on old server I get different disk usage information:
- if i use "zmmailbox -z -m info@mail.com gms", I get 22.25 GB
- but I check this mailbox with du, I get: 146G

There are no shared folders inside those mailboxes. So a lot of emails are missing I guess? If I check this mailbox restored on new server, It also has size of 22.25G.

Can someone please help, I'm getting frustrated here :).
sdesouza
Zimbra Employee
Zimbra Employee
Posts: 1
Joined: Tue Aug 09, 2022 2:14 pm

Re: Cant sync emails

Post by sdesouza »

amaze646 wrote: Sat Oct 15, 2022 10:08 am I get this:

Code: Select all

Err 35/50: Host2: flags msg INBOX/Done/149016 could not add flags [2WEDIDIT!od31do60min:FLAG3077381 Done \Answered \Flagged \Seen]: 87 NO UID STORE failed
Err 36/50: Host2: flags msg INBOX/Done/149310 could not add flags [7IMPROVEMENTod121sometag:FLAG3079385 Done \Answered \Flagged \Seen]: 88 NO UID STORE failed
...
All those flags are defined as tags on new server, and I can see them in webmail. So I can't synchronize these accounts with imapsync. I guessed that folder 88 nad 87 inside /opt/zimbra/store was missing. Some folders did missed. I create it and I get the same error.
Custom Tags created by webclient are seen as Flags by an IMAP client. They will have a new name if the Tag name contains any atom chars. New name format: name:FLAG[0-9]+ - where name is the tag name minus any atom chars, and the numbers are an adjustment of the Tag id.

You can rename them with imapsync to sync the messages. Something like the following added to your imapsync command should work:

Code: Select all

--regexflag 's/:FLAG[0-9]+$//' --regexflag 's/:/_/g'
This should remove the :FLAG[0-9]+ suffix, then replace any stray colons with an underscore. Creating the Tag on the destination after syncing (using the adjusted names for any that have had characters removed - e.g. Special*Char would become SpecialChar) should allow them to resume working on previously tagged items.
Post Reply