OS X Mail not remembering iCloud passwords? Try this.
If you are constantly being asked for your password, Mail's authentication settings may not be properly configured.
Apple's default e-mail client in OS X is its included Mail application, which offers integrated access to Apple's iCloud service and also supports third-party providers like Google and Yahoo, and the ability to set up custom IMAP and POP e-mail accounts.
If you have recently upgraded or updated your Mac, you may run into a situation in which Mail does not appear to store your password for your iCloud account and continually asks for you to enter it. This may happen after installing a new version of OS X, such as OS X Mavericks, or if you have restored or migrated from a backup to a new system.
When password storage and retrieval problems happen in OS X, you may first try troubleshooting by tackling your account's keychains using the Keychain Access utility, but this problem with Mail may happen even if you remove relevant keychain entries or clear and rebuild your keychain from scratch.
Therefore, if you find that Mail is always asking for your iCloud password, first check the authentication method that has been configured for use with Mail for your account. If the authentication method has been changed from Apple's default, which may have been inherited from prior account settings before updating, this can result in Mail not properly handling passwords.
To check the authentication method, go to Mail's preferences and then choose Accounts. In here, select your iCloud account, followed by clicking the Advanced tab. In the drop-down menu for Authentication, ensure that "Apple Token" is selected, as opposed to Password or any other option. Save the settings and then the system should no longer prompt you for a password for iCloud, which it should already have stored if you have logged into iCloud through the iCloud system preferences.