#!/bin/cat
$Id: FAQ.Folders_Sizes.txt,v 1.7 2022/04/23 13:45:15 gilles Exp gilles $

This documentation is also available online at
https://imapsync.lamiral.info/FAQ.d/
https://imapsync.lamiral.info/FAQ.d/FAQ.Folders_Sizes.txt

=======================================================================
  Imapsync tips to know folders sizes.
=======================================================================

Questions answered in this FAQ are:

Q. How can I know the size of all folders before launching a sync?

Q. After a sync, the folders sizes and the number of messages don't 
   match between the source mailbox on host1 and the destination 
   mailbox on host2.
   Why? What can I do about it?

Now the questions again with their answers.

=======================================================================
Q. How can I know the size of all folders before launching a sync?

R. Use --justfoldersizes option.

With the --justfoldersizes option, imapsync evaluates and displays the 
folders sizes on both sides and then exits without doing any transfer.
It also presents the total size of each account, the number of messages,
the biggest message size, the number of folders.

Example:

  imapsync ... --justfoldersizes

=======================================================================
Q. After a sync, the folders sizes and the number of messages don't 
   match between the source mailbox on host1 and the destination 
   mailbox on host2.
   Why? What can I do about it?

R. There are several reasons to explain the different counts between
   source and destination after a sync.
   
1) The sync ended prematurely, before syncing all wanted folders.
   Solution: run new syncs until completion.

2) There are messages on host2 that are not on host1, so host2 is
   bigger than host1. Imapsync doesn't delete any message by default. 
   Solution: use --delete2 to have a strict sync by folder, ie, 
   delete messages on host2 that are not on host1.
   
3) There are folders on host2 that are not on host1, so host2 is 
   bigger. Imapsync doesn't delete any folder by default.
   Solution: use --delete2folders to have a strict sync, ie, 
   delete folders on host2 that are not on host1.

4) There are duplicate messages on host1. Imapsync doesn't sync 
   duplicates by default. But it counts them and presents the number
   found at the end on the line "Messages found duplicate on host1". 
   To sync duplicates, use the option --syncduplicates

5) There are cross-duplicate messages on host1, same messages in different
   folders, and you use --gmail1 or --skipcrossduplicates, which avoid
   copying cross-duplicate messages in more than one folder on host2.
   Use --noskipcrossduplicates if you want imapsync to sync cross-duplicates.

6) There are duplicate messages on host2 so host2 is
   bigger than host1. Solution: use --delete2duplicates to delete
   the host2 duplicates.

7) Cosmic rays...

The important part to take into account for a good and well done sync 
is the last lines of imapsync. A good sync is when you encounter the
three final lines:

"The sync looks good, all xxxx identified messages in host1 are on host2."
"There is no unidentified message on host1."
"Detected 0 errors"

=======================================================================
=======================================================================

 