[sync_mboxes] Deal with empty mboxes earlier.
[sync_mboxes] Fix a bug with non-empty mboxes.