Open Keychain Access, located in Applications/Utilities (or click the link provided on this page). Locate and delete the mail account password item. If this item does not exist, choose File > New Password Item. Enter your mail account information and password. Click Add.
Open Keychain Access, located in Applications/Utilities. Choose Window > Keychain First Aid. Select the mail account you want to check and click Verify, then click the Start button. If the log that appears suggests repairing, click Repair, then click the Start button.
Open Disk Utility, located in Applications/Utilities. Select the volumes (for your hard disk or disks) in the list of disks and volumes. Click Verify Disk, then Repair Disk, if necessary. Send a test email to yourself.
If your password still isn't being saved, choose Mail > Preferences and click Accounts. Delete the mail account that is not saving your password. Add the account again, using the correct settings. You will lose account-specific settings, but not messages. Your messages will be downloaded again from the server. If you have a slow connection, this could take awhile. To test this, send a message to yourself.