How to migrate mail data from Google GSuite to Zimbra


SystemMen - How to migrate mail data from Google GSuite to Zimbra? This article will guide you to do that.

There are many tutorials on how to migrate data from Zimbra to GSuite or from Mdaemon to GSuite. But today, I have the opposite situation, I have to migrate mail data from Gsuite to Zimbra.

First of all, I want to thank this article. In fact, this is the first time I migrated from GSuite to Zimbra.

In the article that I refer to, the author mentioned two ways to migrate mail data. I only use the first method, migrate each account. You can try the other way.

This article I want to share my experience with you.

Prepare steps before migrate mail data

We need to prepare something before we can migrate mail data for a company of about 50 or 100 users or more.

Prepare on Zimbra server

First and of course, you need to create new accounts on zimbra system, to prepare for migrating mail data.

Note: You should set a password of moderate difficulty, do not contain special characters, should only include letters and numbers, it will help you limit errors when executing sync command. You can change the passwords of accounts to become harder after migrate is finished.

Login to Zimbra’s admin window and go to Configure -> Global Settings. Next, do the following 2 things.

1. Firstly, you move to IMAP section and select Enable clear text login.

how-to-migrate-mail-data-from-google-gsuite-to-zimbra-01 How to migrate mail data from Google GSuite to Zimbra
Enable clear text login in IMAP section.

2. Secondly, go to General Information and enter the number 25600 in the Maximum size of a file uploaded from the desktop (KB). Why, Zimbra default only allows 10MB while GSuite allows 25MB.

Therefore, when migrating data from GSuite to Zimbra, we need to edit the file size to the same.

how-to-migrate-mail-data-from-google-gsuite-to-zimbra-02 How to migrate mail data from Google GSuite to Zimbra
Change maximum size of a file uploaded to 25 MB.

And now, ssh to the Zimbra server and type the following command to install imapsync.

# yum install -y epel-release && yum install -y imapsync

Prepare on Gsuite admin account

After you have finished preparing on the Zimbra server, you now need to login to your Gsuite administrator account.

You go to Admin console -> Security -> Basic settings. Choose Enforce access to less secure apps for all users.

how-to-migrate-mail-data-from-google-gsuite-to-zimbra-03 How to migrate mail data from Google GSuite to Zimbra
Select “Enforce access to less secure apps for all users”.

During the migrate of mail data, I encountered the most error that I could not access the gsuite mail account from the imapsync command.

This has 2 factors, you should test login in the browser to make sure you can access your gsuite mail account.

  1. First reason: user activates 2-step authentication by phone. You can use Gsuite administration to turn it off.
  2. The second reason: you need to make an access on the browser from a censored IP, preferably from your office.

Note: To facilitate migrate data, you should reset all account passwords to a single password. Password should only include letters and numbers, to limit errors when executing sync command

If you set a password with many special characters, you may encounter the following error. For example, the password is abc123)(*.

bash: syntax error near unexpected token `)'

This may sound unreasonable, but you must do so. Because you cannot migrate the password from Gsuite to the Zimbra mail system. You can inform the user of the company and then change the password for each person after completion migrate.

Use Imapsync to migrate mail data

After you have prepared, we will now start migrating.

You can test whether migrate is successful by running the following command with the first few accounts.

[root@mail ~]# imapsync --host1 imap.gmail.com --user1 test@yourdomain.com --password1 Abc@123 --host2 mail.yourdomain.com --user2 test@yourdomain.com --password2 Abc@456 --syncinternaldates --ssl1 -ssl2 --noauthmd5 --split1 100 --split2 100 --exclude All Mail --useheader 'Message-Id' --dry --justfolders

The command with option --dry --justfolders will perform a check on migrate but not sync data.

Full test process look like this.

[root@mail ~]# imapsync --host1 imap.gmail.com --user1 test@yourdomain.com --password1 Abc@123 --host2 mail.yourdomain.com --user2 test@yourdomain.com --password2 Abc@456 --syncinternaldates --ssl1 -ssl2 --noauthmd5 --split1 100 --split2 100 --exclude All Mail --useheader 'Message-Id' --dry --justfolders
Transfer started at Thu Jun  6 15:39:00 2019
PID is 901
Log file is LOG_imapsync/2019_06_06_15_39_00_test@yourdomain.com.txt ( to change it, use --logfile path ; or use --nolog to turn off logging )
$RCSfile: imapsync,v $ $Revision: 1.727 $ $Date: 2016/08/19 10:30:36 $
Here is a [linux] system (Linux mail.yourdomain.com 3.10.0-957.12.2.el7.x86_64 #1 SMP Tue May 14 21:24:32 UTC 2019 x86_64)
with Perl 5.16.3 Mail::IMAPClient 3.37
Command line used:
/usr/bin/imapsync --host1 imap.gmail.com --user1 test@yourdomain.com --password1 MASKED --host2 mail.yourdomain.com --user2 test@yourdomain.com --password2 MASKED --syncinternaldates --ssl1 -ssl2 --noauthmd5 --split1 100 --split2 100 --exclude All Mail --useheader Message-Id --dry --justfolders
Temp directory is /tmp  ( to change it use --tmpdir dirpath )
PID file is /tmp/imapsync.pid ( to change it use --pidfile filepath ; to avoid it use --pidfile "" )
Wrinting my PID 901 in /tmp/imapsync.pid
Modules version list:
Mail::IMAPClient     3.37
IO::Socket           1.34
IO::Socket::INET     1.33
IO::Socket::INET6    2.69
IO::Socket::SSL      1.94
Net::SSLeay          1.55
Compress::Zlib       2.061
Digest::MD5          2.52
Digest::HMAC_MD5     1.01
Digest::HMAC_SHA1    1.03
Term::ReadKey        2.30
File::Spec           3.40
Time::HiRes          1.9725
Unicode::String      2.09
IO::Tee              0.64
File::Copy::Recursive 0.38
Authen::NTLM         1.09
URI::Escape          3.31
Data::Uniqid         0.12
JSON                 2.59
JSON::WebToken       0.10
Crypt::OpenSSL::RSA  0.28
LWP                  ?
HTML::Entities       ?
Getopt::Long         2.4
Test::MockObject     1.20120301
( use --no-modulesversion to turn off printing this Perl modules list )
SSL debug mode level is --debugssl 1 (can be set from 0 meaning no debug to 4 meaning max debug)
Host1: SSL default mode is like --sslargs1 SSL_verify_mode=0 meaning SSL_VERIFY_NONE on host1 (do not check the certificate server)
Host1: Use --sslargs1 SSL_verify_mode=1 for SSL_VERIFY_PEER on host1
Host2: SSL default mode is like --sslargs2 SSL_verify_mode=0 meaning SSL_VERIFY_NONE on host2 (do not check the certificate server)
Host2: Use --sslargs2 SSL_verify_mode=1 for SSL_VERIFY_PEER on host2
Info: turned ON syncinternaldates, will set the internal dates (arrival dates) on host2 same as host1.
Host1: will try to use LOGIN authentication on host1
Host2: will try to use LOGIN authentication on host2
Host1: imap connexion timeout is 120 seconds
Host2: imap connexion timeout is 120 seconds
Host1: IMAP server [imap.gmail.com] port [993] user [test@yourdomain.com]
Host2: IMAP server [mail.yourdomain.com] port [993] user [test@yourdomain.com]
Host1: connecting and login on host1 [imap.gmail.com] port [993] with user [test@yourdomain.com]
Host1 banner: * OK Gimap ready for requests from 192.168.10.10 c22mb129799996iod
Host1: imap.gmail.com says it has NO CAPABILITY for AUTHENTICATE LOGIN
Host1: success login on [imap.gmail.com] with user [test@yourdomain.com] auth [LOGIN]
Host2: connecting and login on host2 [mail.yourdomain.com] port [993] with user [test@yourdomain.com]
Host2 banner: * OK IMAP4rev1 proxy server ready
Host2: mail.yourdomain.com says it has NO CAPABILITY for AUTHENTICATE LOGIN
Host2: success login on [mail.yourdomain.com] with user [test@yourdomain.com] auth [LOGIN]
Host1: state Authenticated
Host2: state Authenticated
Host1 capability: IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584
Host2 capability: IMAP4rev1 ACL BINARY CATENATE CHILDREN CONDSTORE ENABLE ESEARCH ESORT I18NLEVEL=1 ID IDLE LIST-EXTENDED LIST-STATUS LITERAL+ LOGIN-REFERRALS MULTIAPPEND NAMESPACE QRESYNC QUOTA RIGHTS=ektx SASL-IR SEARCHRES SORT THREAD=ORDEREDSUBJECT UIDPLUS UNSELECT WITHIN XLIST
Host2: found quota, presented in raw IMAP
Sending: 4 GETQUOTAROOT INBOX
Sent 22 bytes
Read: 	* QUOTAROOT "INBOX" ""
* QUOTA "" (STORAGE 0 512000)
4 OK GETQUOTAROOT completed
Host2: Quota current storage is 0 bytes. Limit is 524288000 bytes. So 0.00 % full
Host1: found 9 folders.
Host2: found 5 folders.
Including all folders found by default. Use --subscribed or --folder or --folderrec or --include to select specific folders. Use --exclude to unselect specific folders.
Excluding folders matching pattern All
[[Gmail]/All Mail]
Host1: checking all wanted folders exist.
Host1: checking all wanted folders are selectable. Use --nocheckselectable to avoid this check.
Host1: warning! ignoring folder [Gmail] because it is not selectable
Host1: guessing separator from folder listing: [/]
Host1: separator given by NAMESPACE: [/]
Host2: guessing separator from folder listing: [/]
Host2: separator given by NAMESPACE: [/]
Host1: guessing prefix from folder listing: []
Host1: prefix given by NAMESPACE: []
Host2: guessing prefix from folder listing: []
Host2: prefix given by NAMESPACE: []
Host1 separator and prefix: [/][]
Host2 separator and prefix: [/][]
Turned off automapping folders ( use --automap to turn on automapping )
++++ Listing folders
All foldernames are presented between brackets like [X] where X is the foldername.
When a foldername contains non-ASCII characters it is presented in the form
[X] = [Y] where
X is the imap foldername you have to use in command line options and
Y is the uft8 output just printed for convenience, to recognize it.
Host1 folders list:
[INBOX]
[[Gmail]]
[[Gmail]/All Mail]
[[Gmail]/Bin]
[[Gmail]/Drafts]
[[Gmail]/Important]
[[Gmail]/Sent Mail]
[[Gmail]/Spam]
[[Gmail]/Starred]
Host2 folders list:
[Drafts]
[INBOX]
[Junk]
[Sent]
[Trash]
Folders in host2 not in host1:
[Trash]
[Sent]
[Junk]
[Drafts]
Folders mapping from --automap feature (use --f1f2 to override any mapping):
Folders mapping from --f1f2 options, it overrides --automap:
++++ Looping on each one of 7 folders to sync
Folder     1/7 [INBOX]                             -> [INBOX]
Host1 folder [INBOX] has 2 messages in total (mentioned by SELECT)
Host2 folder [INBOX] has 0 messages in total (mentioned by SELECT)
Host2: Subscribing to folder INBOX
Folder     2/7 [[Gmail]/Bin]                       -> [[Gmail]/Bin]
Host1 folder [[Gmail]/Bin] has 0 messages in total (mentioned by SELECT)
Creating folder [[Gmail]/Bin] on host2
Creating folder [[Gmail]] on host2
Created  folder [[Gmail]] on host2 	(not really since --dry mode)
Created  folder [[Gmail]/Bin] on host2 	(not really since --dry mode)
Folder     3/7 [[Gmail]/Drafts]                    -> [[Gmail]/Drafts]
Host1 folder [[Gmail]/Drafts] has 0 messages in total (mentioned by SELECT)
Creating folder [[Gmail]/Drafts] on host2
Creating folder [[Gmail]] on host2
Created  folder [[Gmail]] on host2 	(not really since --dry mode)
Created  folder [[Gmail]/Drafts] on host2 	(not really since --dry mode)
Folder     4/7 [[Gmail]/Important]                 -> [[Gmail]/Important]
Host1 folder [[Gmail]/Important] has 0 messages in total (mentioned by SELECT)
Creating folder [[Gmail]/Important] on host2
Creating folder [[Gmail]] on host2
Created  folder [[Gmail]] on host2 	(not really since --dry mode)
Created  folder [[Gmail]/Important] on host2 	(not really since --dry mode)
Folder     5/7 [[Gmail]/Sent Mail]                 -> [[Gmail]/Sent Mail]
Host1 folder [[Gmail]/Sent Mail] has 1 messages in total (mentioned by SELECT)
Creating folder [[Gmail]/Sent Mail] on host2
Creating folder [[Gmail]] on host2
Created  folder [[Gmail]] on host2 	(not really since --dry mode)
Created  folder [[Gmail]/Sent Mail] on host2 	(not really since --dry mode)
Folder     6/7 [[Gmail]/Spam]                      -> [[Gmail]/Spam]
Host1 folder [[Gmail]/Spam] has 0 messages in total (mentioned by SELECT)
Creating folder [[Gmail]/Spam] on host2
Creating folder [[Gmail]] on host2
Created  folder [[Gmail]] on host2 	(not really since --dry mode)
Created  folder [[Gmail]/Spam] on host2 	(not really since --dry mode)
Folder     7/7 [[Gmail]/Starred]                   -> [[Gmail]/Starred]
Host1 folder [[Gmail]/Starred] has 0 messages in total (mentioned by SELECT)
Creating folder [[Gmail]/Starred] on host2
Creating folder [[Gmail]] on host2
Created  folder [[Gmail]] on host2 	(not really since --dry mode)
Created  folder [[Gmail]/Starred] on host2 	(not really since --dry mode)
++++ End looping on each folder
++++ Statistics
Transfer started on               : Thu Jun  6 15:39:00 2019
Transfer ended on                 : Thu Jun  6 15:39:09 2019
Transfer time                     : 9.9 sec
Folders synced                    : 7/7 synced
Messages transferred              : 0 (could be 0 without dry mode)
Messages skipped                  : 0
Messages found duplicate on host1 : 0
Messages found duplicate on host2 : 0
Messages void (noheader) on host1 : 0
Messages void (noheader) on host2 : 0
Messages deleted on host1         : 0
Messages deleted on host2         : 0
Total bytes transferred           : 0 (0.000 KiB)
Total bytes duplicate host1       : 0 (0.000 KiB)
Total bytes duplicate host2       : 0 (0.000 KiB)
Total bytes skipped               : 0 (0.000 KiB)
Total bytes error                 : 0 (0.000 KiB)
Message rate                      : 0.0 messages/s
Average bandwidth rate            : 0.0 KiB/s
Memory consumption                : 297.6 MiB
Biggest message                   : 0 bytes (0.000 KiB)
Memory/biggest message ratio      : NA
Detected 0 errors
New imapsync release 1.921 available
Homepage: http://imapsync.lamiral.info/
Exiting with return value 0
Log file is LOG_imapsync/2019_06_06_15_39_00_test@yourdomain.com.txt ( to change it, use --logfile filepath ; or use --nolog to turn off logging )

After the test has finished, you can run the following command to migrate the actual data. Execute each command one by one account.

The command.

[root@mail ~]# imapsync --host1 imap.gmail.com --user1 test@yourdomain.com --password1 Abc@123 --host2 mail.yourdomain.com --user2 test@yourdomain.com --password2 Abc@456 --syncinternaldates --ssl1 -ssl2 --noauthmd5 --split1 100 --split2 100 --exclude All Mail --useheader 'Message-Id'
[root@mail ~]# imapsync --host1 imap.gmail.com --user1 test@yourdomain.com --password1 Abc@123 --host2 mail.yourdomain.com --user2 test@yourdomain.com --password2 Abc@456 --syncinternaldates --ssl1 -ssl2 --noauthmd5 --split1 100 --split2 100 --exclude All Mail --useheader 'Message-Id'
Transfer started at Thu Jun  6 15:40:56 2019
PID is 2177
Log file is LOG_imapsync/2019_06_06_15_40_56_test@yourdomain.com.txt ( to change it, use --logfile path ; or use --nolog to turn off logging )
$RCSfile: imapsync,v $ $Revision: 1.727 $ $Date: 2016/08/19 10:30:36 $
Here is a [linux] system (Linux mail.yourdomain.com 3.10.0-957.12.2.el7.x86_64 #1 SMP Tue May 14 21:24:32 UTC 2019 x86_64)
with Perl 5.16.3 Mail::IMAPClient 3.37
Command line used:
/usr/bin/imapsync --host1 imap.gmail.com --user1 test@yourdomain.com --password1 MASKED --host2 mail.yourdomain.com --user2 test@yourdomain.com --password2 MASKED --syncinternaldates --ssl1 -ssl2 --noauthmd5 --split1 100 --split2 100 --exclude All Mail --useheader Message-Id
Temp directory is /tmp  ( to change it use --tmpdir dirpath )
PID file is /tmp/imapsync.pid ( to change it use --pidfile filepath ; to avoid it use --pidfile "" )
Wrinting my PID 2177 in /tmp/imapsync.pid
Modules version list:
Mail::IMAPClient     3.37
IO::Socket           1.34
IO::Socket::INET     1.33
IO::Socket::INET6    2.69
IO::Socket::SSL      1.94
Net::SSLeay          1.55
Compress::Zlib       2.061
Digest::MD5          2.52
Digest::HMAC_MD5     1.01
Digest::HMAC_SHA1    1.03
Term::ReadKey        2.30
File::Spec           3.40
Time::HiRes          1.9725
Unicode::String      2.09
IO::Tee              0.64
File::Copy::Recursive 0.38
Authen::NTLM         1.09
URI::Escape          3.31
Data::Uniqid         0.12
JSON                 2.59
JSON::WebToken       0.10
Crypt::OpenSSL::RSA  0.28
LWP                  ?
HTML::Entities       ?
Getopt::Long         2.4
Test::MockObject     1.20120301
( use --no-modulesversion to turn off printing this Perl modules list )
SSL debug mode level is --debugssl 1 (can be set from 0 meaning no debug to 4 meaning max debug)
Host1: SSL default mode is like --sslargs1 SSL_verify_mode=0 meaning SSL_VERIFY_NONE on host1 (do not check the certificate server)
Host1: Use --sslargs1 SSL_verify_mode=1 for SSL_VERIFY_PEER on host1
Host2: SSL default mode is like --sslargs2 SSL_verify_mode=0 meaning SSL_VERIFY_NONE on host2 (do not check the certificate server)
Host2: Use --sslargs2 SSL_verify_mode=1 for SSL_VERIFY_PEER on host2
Info: turned ON syncinternaldates, will set the internal dates (arrival dates) on host2 same as host1.
Host1: will try to use LOGIN authentication on host1
Host2: will try to use LOGIN authentication on host2
Host1: imap connexion timeout is 120 seconds
Host2: imap connexion timeout is 120 seconds
Host1: IMAP server [imap.gmail.com] port [993] user [test@yourdomain.com]
Host2: IMAP server [mail.yourdomain.com] port [993] user [test@yourdomain.com]
Host1: connecting and login on host1 [imap.gmail.com] port [993] with user [test@yourdomain.com]
Host1 banner: * OK Gimap ready for requests from 103.95.198.193 m14mb565718241pjr
Host1: imap.gmail.com says it has NO CAPABILITY for AUTHENTICATE LOGIN
Host1: success login on [imap.gmail.com] with user [test@yourdomain.com] auth [LOGIN]
Host2: connecting and login on host2 [mail.yourdomain.com] port [993] with user [test@yourdomain.com]
Host2 banner: * OK IMAP4rev1 proxy server ready
Host2: mail.yourdomain.com says it has NO CAPABILITY for AUTHENTICATE LOGIN
Host2: success login on [mail.yourdomain.com] with user [test@yourdomain.com] auth [LOGIN]
Host1: state Authenticated
Host2: state Authenticated
Host1 capability: IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584
Host2 capability: IMAP4rev1 ACL BINARY CATENATE CHILDREN CONDSTORE ENABLE ESEARCH ESORT I18NLEVEL=1 ID IDLE LIST-EXTENDED LIST-STATUS LITERAL+ LOGIN-REFERRALS MULTIAPPEND NAMESPACE QRESYNC QUOTA RIGHTS=ektx SASL-IR SEARCHRES SORT THREAD=ORDEREDSUBJECT UIDPLUS UNSELECT WITHIN XLIST
Host2: found quota, presented in raw IMAP
Sending: 4 GETQUOTAROOT INBOX
Sent 22 bytes
Read: 	* QUOTAROOT "INBOX" ""
* QUOTA "" (STORAGE 0 512000)
4 OK GETQUOTAROOT completed
Host2: Quota current storage is 0 bytes. Limit is 524288000 bytes. So 0.00 % full
Host1: found 9 folders.
Host2: found 5 folders.
Including all folders found by default. Use --subscribed or --folder or --folderrec or --include to select specific folders. Use --exclude to unselect specific folders.
Excluding folders matching pattern All
[[Gmail]/All Mail]
Host1: checking all wanted folders exist.
Host1: checking all wanted folders are selectable. Use --nocheckselectable to avoid this check.
Host1: warning! ignoring folder [Gmail] because it is not selectable
Host1: guessing separator from folder listing: [/]
Host1: separator given by NAMESPACE: [/]
Host2: guessing separator from folder listing: [/]
Host2: separator given by NAMESPACE: [/]
Host1: guessing prefix from folder listing: []
Host1: prefix given by NAMESPACE: []
Host2: guessing prefix from folder listing: []
Host2: prefix given by NAMESPACE: []
Host1 separator and prefix: [/][]
Host2 separator and prefix: [/][]
Turned off automapping folders ( use --automap to turn on automapping )
++++ Listing folders
All foldernames are presented between brackets like [X] where X is the foldername.
When a foldername contains non-ASCII characters it is presented in the form
[X] = [Y] where
X is the imap foldername you have to use in command line options and
Y is the uft8 output just printed for convenience, to recognize it.
Host1 folders list:
[INBOX]
[[Gmail]]
[[Gmail]/All Mail]
[[Gmail]/Bin]
[[Gmail]/Drafts]
[[Gmail]/Important]
[[Gmail]/Sent Mail]
[[Gmail]/Spam]
[[Gmail]/Starred]
Host2 folders list:
[Drafts]
[INBOX]
[Junk]
[Sent]
[Trash]
Folders in host2 not in host1:
[Trash]
[Sent]
[Junk]
[Drafts]
Folders mapping from --automap feature (use --f1f2 to override any mapping):
Folders mapping from --f1f2 options, it overrides --automap:
Folders sizes before the synchronization.
You can remove foldersizes listings by using "--nofoldersizes" and  "--nofoldersizesatend"
but then you will also loose the ETA (Estimation Time of Arrival) given after each message copy.
++++ Calculating sizes of 7 folders on Host1
Host1 folder     1/7 [INBOX]                             Size:     14401 Messages:     2 Biggest:      9551
Host1 folder     2/7 [[Gmail]/Bin]                       Size:         0 Messages:     0 Biggest:         0
Host1 folder     3/7 [[Gmail]/Drafts]                    Size:         0 Messages:     0 Biggest:         0
Host1 folder     4/7 [[Gmail]/Important]                 Size:         0 Messages:     0 Biggest:         0
Host1 folder     5/7 [[Gmail]/Sent Mail]                 Size:       598 Messages:     1 Biggest:       598
Host1 folder     6/7 [[Gmail]/Spam]                      Size:         0 Messages:     0 Biggest:         0
Host1 folder     7/7 [[Gmail]/Starred]                   Size:         0 Messages:     0 Biggest:         0
Host1 Nb folders:                7 folders
Host1 Nb messages:               3 messages
Host1 Total size:            14999 bytes (14.647 KiB)
Host1 Biggest message:        9551 bytes (9.327 KiB)
Host1 Time spent:              9.3 seconds
++++ Calculating sizes of 7 folders on Host2
Host2 folder     1/7 [INBOX]                             Size:         0 Messages:     0 Biggest:         0
Host2 folder     2/7 [[Gmail]/Bin]                       does not exist yet
Host2 folder     3/7 [[Gmail]/Drafts]                    does not exist yet
Host2 folder     4/7 [[Gmail]/Important]                 does not exist yet
Host2 folder     5/7 [[Gmail]/Sent Mail]                 does not exist yet
Host2 folder     6/7 [[Gmail]/Spam]                      does not exist yet
Host2 folder     7/7 [[Gmail]/Starred]                   does not exist yet
Host2 Nb folders:                7 folders
Host2 Nb messages:               0 messages
Host2 Total size:                0 bytes (0.000 KiB)
Host2 Biggest message:           0 bytes (0.000 KiB)
Host2 Time spent:              0.0 seconds
++++ Looping on each one of 7 folders to sync
Folder     1/7 [INBOX]                             -> [INBOX]
Host1 folder [INBOX] has 2 messages in total (mentioned by SELECT)
Host2 folder [INBOX] has 0 messages in total (mentioned by SELECT)
Host2: Subscribing to folder INBOX
Host1 folder [INBOX] considering 2 messages
Host2 folder [INBOX] considering 0 messages
msg INBOX/1 {4850}            copied to INBOX/257        0.73 msgs/s  3.461 KiB/s 4.736 KiB copied  ETA: Thu Jun  6 15:41:09 2019  3 s  2/3 msgs left
msg INBOX/2 {9551}            copied to INBOX/258        1.21 msgs/s  8.529 KiB/s 14.063 KiB copied  ETA: Thu Jun  6 15:41:07 2019  1 s  1/3 msgs left
Folder     2/7 [[Gmail]/Bin]                       -> [[Gmail]/Bin]
Host1 folder [[Gmail]/Bin] has 0 messages in total (mentioned by SELECT)
Creating folder [[Gmail]/Bin] on host2
Creating folder [[Gmail]] on host2
Created folder [[Gmail]] on host2
Created folder [[Gmail]/Bin] on host2
Host2 folder [[Gmail]/Bin] has 0 messages in total (mentioned by SELECT)
Host2: Subscribing to folder [Gmail]/Bin
Host1 folder [[Gmail]/Bin] considering 0 messages
Host2 folder [[Gmail]/Bin] considering 0 messages
Folder     3/7 [[Gmail]/Drafts]                    -> [[Gmail]/Drafts]
Host1 folder [[Gmail]/Drafts] has 0 messages in total (mentioned by SELECT)
Creating folder [[Gmail]/Drafts] on host2
Created folder [[Gmail]/Drafts] on host2
Host2 folder [[Gmail]/Drafts] has 0 messages in total (mentioned by SELECT)
Host2: Subscribing to folder [Gmail]/Drafts
Host1 folder [[Gmail]/Drafts] considering 0 messages
Host2 folder [[Gmail]/Drafts] considering 0 messages
Folder     4/7 [[Gmail]/Important]                 -> [[Gmail]/Important]
Host1 folder [[Gmail]/Important] has 0 messages in total (mentioned by SELECT)
Creating folder [[Gmail]/Important] on host2
Created folder [[Gmail]/Important] on host2
Host2 folder [[Gmail]/Important] has 0 messages in total (mentioned by SELECT)
Host2: Subscribing to folder [Gmail]/Important
Host1 folder [[Gmail]/Important] considering 0 messages
Host2 folder [[Gmail]/Important] considering 0 messages
Folder     5/7 [[Gmail]/Sent Mail]                 -> [[Gmail]/Sent Mail]
Host1 folder [[Gmail]/Sent Mail] has 1 messages in total (mentioned by SELECT)
Creating folder [[Gmail]/Sent Mail] on host2
Created folder [[Gmail]/Sent Mail] on host2
Host2 folder [[Gmail]/Sent Mail] has 0 messages in total (mentioned by SELECT)
Host2: Subscribing to folder [Gmail]/Sent Mail
Host1 folder [[Gmail]/Sent Mail] considering 1 messages
Host2 folder [[Gmail]/Sent Mail] considering 0 messages
msg [Gmail]/Sent Mail/1 {598}             copied to [Gmail]/Sent Mail/264        0.69 msgs/s  3.385 KiB/s 14.647 KiB copied  ETA: Thu Jun  6 15:41:09 2019  0 s  0/3 msgs left
Folder     6/7 [[Gmail]/Spam]                      -> [[Gmail]/Spam]
Host1 folder [[Gmail]/Spam] has 0 messages in total (mentioned by SELECT)
Creating folder [[Gmail]/Spam] on host2
Created folder [[Gmail]/Spam] on host2
Host2 folder [[Gmail]/Spam] has 0 messages in total (mentioned by SELECT)
Host2: Subscribing to folder [Gmail]/Spam
Host1 folder [[Gmail]/Spam] considering 0 messages
Host2 folder [[Gmail]/Spam] considering 0 messages
Folder     7/7 [[Gmail]/Starred]                   -> [[Gmail]/Starred]
Host1 folder [[Gmail]/Starred] has 0 messages in total (mentioned by SELECT)
Creating folder [[Gmail]/Starred] on host2
Created folder [[Gmail]/Starred] on host2
Host2 folder [[Gmail]/Starred] has 0 messages in total (mentioned by SELECT)
Host2: Subscribing to folder [Gmail]/Starred
Host1 folder [[Gmail]/Starred] considering 0 messages
Host2 folder [[Gmail]/Starred] considering 0 messages
++++ End looping on each folder
Folders sizes after the synchronization.
You can remove this foldersizes listing by using  "--nofoldersizesatend"
++++ Calculating sizes of 7 folders on Host1
Host1 folder     1/7 [INBOX]                             Size:     14401 Messages:     2 Biggest:      9551
Host1 folder     2/7 [[Gmail]/Bin]                       Size:         0 Messages:     0 Biggest:         0
Host1 folder     3/7 [[Gmail]/Drafts]                    Size:         0 Messages:     0 Biggest:         0
Host1 folder     4/7 [[Gmail]/Important]                 Size:         0 Messages:     0 Biggest:         0
Host1 folder     5/7 [[Gmail]/Sent Mail]                 Size:       598 Messages:     1 Biggest:       598
Host1 folder     6/7 [[Gmail]/Spam]                      Size:         0 Messages:     0 Biggest:         0
Host1 folder     7/7 [[Gmail]/Starred]                   Size:         0 Messages:     0 Biggest:         0
Host1 Nb folders:                7 folders
Host1 Nb messages:               3 messages
Host1 Total size:            14999 bytes (14.647 KiB)
Host1 Biggest message:        9551 bytes (9.327 KiB)
Host1 Time spent:              3.4 seconds
++++ Calculating sizes of 7 folders on Host2
Host2 folder     1/7 [INBOX]                             Size:     14401 Messages:     2 Biggest:      9551
Host2 folder     2/7 [[Gmail]/Bin]                       Size:         0 Messages:     0 Biggest:         0
Host2 folder     3/7 [[Gmail]/Drafts]                    Size:         0 Messages:     0 Biggest:         0
Host2 folder     4/7 [[Gmail]/Important]                 Size:         0 Messages:     0 Biggest:         0
Host2 folder     5/7 [[Gmail]/Sent Mail]                 Size:       598 Messages:     1 Biggest:       598
Host2 folder     6/7 [[Gmail]/Spam]                      Size:         0 Messages:     0 Biggest:         0
Host2 folder     7/7 [[Gmail]/Starred]                   Size:         0 Messages:     0 Biggest:         0
Host2 Nb folders:                7 folders
Host2 Nb messages:               3 messages
Host2 Total size:            14999 bytes (14.647 KiB)
Host2 Biggest message:        9551 bytes (9.327 KiB)
Host2 Time spent:              0.3 seconds
++++ Statistics
Transfer started on               : Thu Jun  6 15:40:56 2019
Transfer ended on                 : Thu Jun  6 15:41:14 2019
Transfer time                     : 18.4 sec
Folders synced                    : 7/7 synced
Messages transferred              : 3
Messages skipped                  : 0
Messages found duplicate on host1 : 0
Messages found duplicate on host2 : 0
Messages void (noheader) on host1 : 0
Messages void (noheader) on host2 : 0
Messages deleted on host1         : 0
Messages deleted on host2         : 0
Total bytes transferred           : 14999 (14.647 KiB)
Total bytes duplicate host1       : 0 (0.000 KiB)
Total bytes duplicate host2       : 0 (0.000 KiB)
Total bytes skipped               : 0 (0.000 KiB)
Total bytes error                 : 0 (0.000 KiB)
Message rate                      : 0.2 messages/s
Average bandwidth rate            : 0.8 KiB/s
Memory consumption                : 299.6 MiB
Biggest message                   : 9551 bytes (9.327 KiB)
Memory/biggest message ratio      : 32887.7
Start difference host2 - host1    : -3 messages, -14999 bytes (-14.647 KiB)
Final difference host2 - host1    : 0 messages, 0 bytes (0.000 KiB)
Detected 0 errors
New imapsync release 1.921 available
Homepage: http://imapsync.lamiral.info/
Exiting with return value 0
Log file is LOG_imapsync/2019_06_06_15_40_56_test@yourdomain.com.txt ( to change it, use --logfile filepath ; or use --nolog to turn off logging )

Conclusion

This article, I tried to share my experience in detail as possible. The imapsync command only has one command, you only need to replace the username and password for each account and sync one by one. However, in the process of implementation, you may encounter things that I have encountered. Hope, this article helps you.

«« »»