move the sync code to only run if there's an imap source