iCloud Two-Factor Authentication

Mailspring does not support two-factor authentication with iCloud. Instead, you need to create an app-specific password and use it to login. See: Two-Factor Authentication/App Passwords