Move mailsync functionality to the database backends.