Unable to set up iCloud email on mail.app after accidentally deleting the ~/Library/Mail/ folder
Instead of selecting "iCloud" when adding the account, try "Add Other Mail Account..." and follow the configuration steps. Repost from comment for thread closure.