Mac Mail Get Unexpected Email Address When Config Email by .mobileconfig File

2

I want to simplify e-mail account configuration on Mac OS, after a lot Googling I think this work can be done by generating a template profile file (.mobileconfig) from iPCU and deploying this profile.

When I installed the .mobileconfig file, I found the email address in Mail's account setting is not the same as I wrote in iPCU.

Here is a part of .mobileconfig files generated by iPCU:

<key>EmailAccountDescription</key>
<string>alimailtest</string>
<key>EmailAccountName</key>
<string>fullname</string>
<key>EmailAccountType</key>
<string>EmailTypeIMAP</string>
<key>EmailAddress</key>
<string>testuser@testcompany.com</string>
<key>IncomingMailServerAuthentication</key>
<string>EmailAuthPassword</string>
<key>IncomingMailServerHostName</key>
<string>imap.testcompany.com</string>
<key>IncomingMailServerPortNumber</key>
<integer>993</integer>
<key>IncomingMailServerUseSSL</key>
<true/>
<key>IncomingMailServerUsername</key>
<string>testuser@testcompany.com</string>

But unexpectly, after installing this profile, I got "testuser@testcompany.com@imap.testcompany.com" as email address in Mail's account setting. It seems Mac appends the incoming server name after email address mistakenly, this causes failure on mail outsending.

Are there any ways to correct the profile installing? Or one step back, modify Mail's account setting by some program after installing. Or even config Mac Mail's setting without .mobileconfig mechanism?

Anyone help please?

caogtaa

Posted 2012-12-18T16:27:46.807

Reputation: 31

Someone has met same problem: link

– None – 2012-12-19T05:53:27.703

Answers

1

I finally work around this problem by wrapping the config process with an App.

  1. Prompt a dialog for user to input the email address, remember this value for later use
  2. Write user email address to profile template, the profile template was generated by IPCU and have some sections filled by placeholders
  3. Import profile by "/usr/bin/profiles -I -F %profilename%" command
  4. Open ~/Library/Mail/V2/MailData/Accounts.plist and update the wrong email address with the one in step-1. Done.

Password is required when user launch Mail.

caogtaa

Posted 2012-12-18T16:27:46.807

Reputation: 31