Code: Select all
host1="source-IP"
host2="destination-IP"
username="user@domain"
admin_account_password="zimbra-admin-password"
imapsync \
--host1 "$host1" --host2 "$host2" --automap --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|Notebook|Tasks)(?=/|$), $1 Folder,ig" \
--regextrans2 's,\",-,g' \
Problem is, it also tried to sync Emailed Contacts, create a folder named Folder and put contact files in it.
How to resolve this?