Move ImapConnectFn typedef to imap_client_factory so it can be shared. Inject it into AccountSyncManager/_AccountSync so tests can substitute a no-op instead of hitting a real IMAP server. _AccountSync._sync() now iterates all mailboxes from the repository after syncMailboxes, mirroring the JMAP loop that was already in place. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>