0

I tried to find imapsync options and parameters to sync and delete older emails on destination zimbra 8.7.7 mailbox from zimbra 7.1.4. 2 tests were successful so far but with additional folder named Folder with contact files in it.

Below is command in a shell script and its options used:

host1="IP-source"
host2="IP-destination"
username="user@domain"
admin_account_password="zimbra-admin-password"
imapsync \
  --host1 "$host1" --host2 "$host2" --useuid --delete2 \
  --user1 "$username" --authuser1 admin \
  --ssl1 --authmech1 PLAIN \
  --password1 "$admin_account_password" \
  --user2 "$username" --authuser2 admin \
  --ssl2 --authmech2 PLAIN  \
  --password2 "$admin_account_password" \
  --maxsize 52428800 --buffersize 8192000 \
  --nofoldersizes --nosyncacls --subscribe --syncinternaldates \
  --authmech2 PLAIN \
  --exclude '(?i)\b(Junk|Spam|Trash)\b' \
  --regextrans2 "s,&AAo-|&AA0ACg-|&AA0ACgANAAo-(?=/|$),,g" \
  --regexflag 's/\\\\(?!Answered|Flagged|Deleted|Seen|Recent|Draft)[^\s]*\s*//ig' --debugflags \
  --regextrans2 's,:,-,g' \
  --regextrans2 's,\",'\'',g' \
  --regextrans2 's,\s+(?=/|$),,g' \
  --regextrans2 "s,^(Briefcase|Calendar|Contacts|Emailed Contacts|Notebook|Tasks)(?=/|$), $1 Folder,ig" \
  --regextrans2 's,\",-,g' \

imapsync 1.727 on CentOS 7

So, what caused that folder to appear and how not to make it not appear?

  • And the question is how to not get that folder? – phk May 1 '17 at 23:11
  • Maybe the Blank in "Emailed Contacts" ? – ridgy May 2 '17 at 11:21
  • when I removed "Emailed Contacts" from regextrans2, I got error "Err 1/1: Could not create folder [Emailed Contacts] from [Emailed Contacts]: 22 NO CREATE failed: mailbox already exists" – grepmaster May 3 '17 at 2:02
  • my bad, I have to exclude both contacts folder – grepmaster May 3 '17 at 8:24
0

It seems that I need to exclude both Emailed Contacts & Contacts folder seen by imapsync.

diff

16c
  --exclude '(?i)\b(Junk|Spam|Trash|Emailed \Contacts|Contacts)\b' \
.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.