Mail plist reading and writing
Our security gurus are demanding that all mail transactions be secure ...
so - how do i go about scanning all of my macs, and finding all users on a given box, reading their per client mail settings, finding the settings block for our server, and change the settings to be "secure"
I can read en bulk
defaults read com.apple.mail MailAccounts
I can (in theory) use that to scan each user's mail.plist
but - how do I drill down to only read the Hostname section that applies to the server in question?
once that is done, I should be able to defaults write the changes to
PortNumber = 993;
SMTPIdentifier = "YourServer.here";
SSLEnabled = YES;
SecurityLayerType = 3;
but if they have multiple email accounts - I need to be sure that it is the "correct" one
MailAccounts "names" can be anything - as there is no standardization in that field (around here)
I care about matching the Hostname, once I know that I need to grab the MailAccount and then write out the sections
I suppose I can read each mail account - test values and move on...????
is there an easy way to script the xml reading?
Rich