Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c El Capitan-如何阅读Mac Os X邮件帐户信息_Objective C_Macos_Osx Elcapitan - Fatal编程技术网

Objective c El Capitan-如何阅读Mac Os X邮件帐户信息

Objective c El Capitan-如何阅读Mac Os X邮件帐户信息,objective-c,macos,osx-elcapitan,Objective C,Macos,Osx Elcapitan,我有一个应用程序,它使用Accounts.plist的内容。 升级到Mac OS El Capitan/10.11.1后,新邮件路径下不支持Accounts.plist 之前: /Users/[homefolder]/Library/Mail/v2/MailData/Accounts.plist 现在: 现在如何获取邮件帐户详细信息?偶然发现了一种更干净的方法。请参阅SBSendMail()了解苹果的脚本桥。然后读取smtp服务器: MailApplication *mail = [SBAp

我有一个应用程序,它使用Accounts.plist的内容。 升级到Mac OS El Capitan/10.11.1后,新邮件路径下不支持Accounts.plist

之前:

/Users/[homefolder]/Library/Mail/v2/MailData/Accounts.plist
现在:


现在如何获取邮件帐户详细信息?

偶然发现了一种更干净的方法。请参阅SBSendMail()了解苹果的脚本桥。然后读取smtp服务器:

 MailApplication *mail = [SBApplication applicationWithBundleIdentifier:@"com.apple.Mail"];

    /* set ourself as the delegate to receive any errors */
    mail.delegate = self;

    SBElementArray *smtpServers = mail.smtpServers;

    for (MailSmtpServer *server in smtpServers)
    {
        NSLog(@"%@ %@ %@ %@ %d", server.name, server.password, server.userName, server.serverName, server.port);
    }

您可以类似地阅读IMAP&POP帐户设置。

sudo find/Users/[homefolder]/Library/Mail/-iname“Accounts.plist”
谢谢您,Thomas,但是Accounts.plist不再受支持,因此我需要一个其他来源,可以从中获取邮件帐户信息。您需要哪些信息?邮件帐户的内容-数组。FullUserName,uniqueId,accountname文件在邮件容器中:
~/Library/Containers/com.apple.Mail/Data/Library/Preferences/com.apple.Mail.plist
,但我找不到
MailAccount
类(
MailApplication.accounts
)的
uniqueId
。我需要
mailcount
uniqueID
/Users/[homefolder]/Library/Mail/v3/MailData/Signatures
下的
AccountsMap.plist
中查找相关签名
 MailApplication *mail = [SBApplication applicationWithBundleIdentifier:@"com.apple.Mail"];

    /* set ourself as the delegate to receive any errors */
    mail.delegate = self;

    SBElementArray *smtpServers = mail.smtpServers;

    for (MailSmtpServer *server in smtpServers)
    {
        NSLog(@"%@ %@ %@ %@ %d", server.name, server.password, server.userName, server.serverName, server.port);
    }