The defaults method

set mailAccts to do shell script “defaults read com.apple.mail MailAccounts”

You could be on to something here with the defaults method of configuring AppleMail - - - then I wouldn’t even need to launch AppleMail to configure it. Can anyone tell me, however where the SMTP account password is stored, and where the user-password is stored. For instance, if I want to add an account, and I know the password, where would I put it?

I’m not sure where Mail.app passwords are store, but I’m sure they would be encrypted.

On my machine, the passwords appear to be stored in the Keychain (also scriptable).

Ah - - now things are really getting interesting. I took a look at the dictionary for the keychain. Anyone know how you’d go about creating a password in keychain, and then linking it somehow to the SMTP server password that AppleMail wants in a particular account?