User Tag List

  1. drivesoslow's Avatar
    I do not know if this is limited to any number of Exchange ActiveSync push accounts but I currently have two working side-by-side. Here is how:

    Setup one Exchange account on your phone.

    SSH into your phone and edit /private/var/mobile/Library/Preferences/com.apple.accountsettings.plist

    Look for the section that covers your current Exchange account, copy it and paste it below the current entry. Edit the value of ASAccountEmailAddress and Identifier. Save the file.

    Go to Settings and under mail accounts you will see one with the value you assigned to ASAAccountEmailAddress, edit this account and change the server, username, and password to your second Exchange server.

    Here is a copy of my files will only the email addresses and server names changed.

    Code:
    {
        Accounts =     (
                    {
                Class = DeviceLocalAccount;
                "Enabled Dataclasses" =             (
                    "com.apple.Dataclass.Bookmarks",
                    "com.apple.Dataclass.Notes"
                );
                Identifier = DeviceLocalAccount;
                "Short Type String" = "On My iPod touch";
                Type = OnMyDevice;
                "Type String" = "On My iPod touch";
            },
                    {
                AccountPath = "/var/mobile/Library/Mail/Mailboxes";
                Class = LocalAccount;
                DraftsMailboxName = Drafts;
                Identifier = "A49ABBBD-04BB-4AF8-B95C-C351A63F1D8F";
                SentMessagesMailboxName = "Sent Messages";
                "Short Type String" = Local;
                "Sync Identifier" = LocalAccountId;
                TrashMailboxName = "Deleted Messages";
                Type = Mail;
                "Type String" = Local;
            },
                    {
                ASAccountEmailAddress = "[email protected]";
                ASAccountHost = "server1.com";
                ASAccountMailNumberOfPastDaysToSync = 0;
                ASAccountUseSSL = 1;
                ASAccountUsername = "[email protected]";
                ASLastKnownProtocolVersion = "12.1";
                Class = ASAccount;
                DAAccountPersistentUUID = "BE5EC6C9-B1C0-4B21-8E03-6F4885748682";
                DAAccountVersion = 2;
                DisplayName = "server1.com";
                "Enabled Dataclasses" =             (
                    "com.apple.Dataclass.Calendars",
                    "com.apple.Dataclass.Contacts",
                    "com.apple.Dataclass.Mail",
                    "com.apple.Dataclass.ContactsSearch"
                );
                Identifier = "30FD82D3-411D-40FF-A609-A70D4A85252E";
                "Short Type String" = Exchange;
                "Sync Identifier" = "30FD82D3-411D-40FF-A609-A70D4A85252E";
                Type = Exchange;
                "Type String" = "Exchange ActiveSync";
                kASAccountVersionKey = 7;
            },
                    {
                ASAccountEmailAddress = "[email protected]";
                ASAccountEmailAddresses = "[email protected]";
                ASAccountHost = "server2.com";
                ASAccountMailNumberOfPastDaysToSync = 0;
                ASAccountUseSSL = 1;
                ASAccountUsername = "[email protected]";
                ASLastKnownProtocolVersion = "12.1";
                Class = ASAccount;
                DAAccountPersistentUUID = "BE5EC6C9-B1C0-4B21-8E03-6F4885748682";
                DAAccountVersion = 2;
                DisplayName = server2.com;
                "Enabled Dataclasses" =             (
                    "com.apple.Dataclass.Calendars",
                    "com.apple.Dataclass.Contacts",
                    "com.apple.Dataclass.Mail",
                    "com.apple.Dataclass.ContactsSearch"
                );
                Identifier = "31C7D34D-2CFD-41FF-8A46-2819D2DE47A1";
                "Short Type String" = Exchange;
                "Sync Identifier" = "31C7D34D-2CFD-41FF-8A46-2819D2DE47A1";
                Type = Exchange;
                "Type String" = "Exchange ActiveSync";
                kASAccountVersionKey = 7;
            }
        );
        Version = 4;
    }
    I should state that I haven't used this long enough to comment on battery life.

    Last edited by drivesoslow; 2009-11-12 at 01:38 PM. Reason: Automerged Doublepost
    2009-11-06 12:54 AM
  2. davpel's Avatar
    Brilliant!! Nice work. I've been waiting for someone to figure this out for ages. Thanks!
    2009-11-06 01:29 AM
  3. drivesoslow's Avatar
    DAAccountPersistentUUID may need to be altered also on the second account
    2009-11-06 01:58 AM
  4. noah82's Avatar
    You are a genius!!! I just did it and this works like a charm!
    2009-11-06 02:06 AM
  5. drivesoslow's Avatar
    I'm a day into running this mod and there does not seem to be any adverse battery effect.
    2009-11-06 04:29 PM
  6. lolento's Avatar
    HOLY SMOKES!!!!

    I will try it but if this is working, please STICKY

    Guys,

    please comment if push mail, push calendar, and push contacts work on both accounts?

    thanks,
    Last edited by lolento; 2009-11-06 at 08:39 PM. Reason: Automerged Doublepost
    2009-11-06 08:39 PM
  7. drivesoslow's Avatar
    I have calendar, mail, and contacts working on both accounts
    2009-11-06 09:06 PM
  8. lolento's Avatar
    drivesoslow,

    thanks for the feedback, I'm going to try it now...

    does this method merge the calendar and contacts?
    For example, if I have a work exchange account and a google exchange account does the calendar events in my work exchange account get sync into my google account? (I don't want this to happen)
    Also, if I have same contacts in my work exchange account and my google account, will I see double entries? (I don't want this either)

    thanks!

    One more question, when you create a Calendar item on the iphone does it sync to both accounts?
    Last edited by lolento; 2009-11-06 at 10:18 PM. Reason: Automerged Doublepost
    2009-11-06 10:18 PM
  9. noah82's Avatar
    My battery seems to be draining a bit more than normal, but I am more than willing to keep a charger handy for this functionality!
    2009-11-06 10:33 PM
  10. lolento's Avatar
    Answering my own questions...

    Yes, you will have double contacts if you have same contacts on both accounts...

    But calendar events are separate.

    Adding calendar events can be done selectively to one account.

    GOOD WORK DRIVESOSLOW! LOVING IT!

    Also, you're right, DAAccountPersistentUUID need to be different on both accounts (so please correct the op).
    Last edited by lolento; 2009-11-06 at 11:10 PM.
    2009-11-06 11:06 PM
  11. posrjak's Avatar
    I have tried this serval times and it just lists the last exchange acount on my plist. Which ever one I put the information in second on the plist is list in email settings. I am using plist editor for windows on windows xp and I have 32 gig 3gs. Not sure what I am doing wrong, can any on provide advice?

    <dict>
    <key>ASAccountEmailAddress</key>
    <string>[email protected]</string>
    <key>ASAccountHost</key>
    <string>m.google..com</string>
    <key>ASAccountMailNumberOfPastDaysToSync</key>
    <integer>0</integer>
    <key>ASAccountUseSSL</key>
    <true/>
    <key>ASAccountUsername</key>
    <string>[email protected]</string>
    <key>ASLastKnownProtocolVersion</key>
    <string>2.5</string>
    <key>Class</key>
    <string>ASAccount</string>
    <key>DAAccountPersistentUUID</key>
    <string>47F76882-2678-41C7-91B9-5D1AD5F76BFA</string>
    <key>DAAccountVersion</key>
    <integer>2</integer>
    <key>DATrustSettingsExceptions</key>
    <dict>
    <key>b8fa0b7f 0e99494e e3210953 21fa4725 65454492</key>
    <data>
    YnBsaXN0MDChAdICAwQFW1NTTEhvc3RuYW1lWlNIQTFE
    aWdlc3QITxAUuPoLfw6ZSU7jIQlTIfpHJWVFRJIICg8b
    JicAAAAAAAABAQAAAAAAAAAGAAAAAAAAAAAAAAAAAAAA
    Pg==
    </data>
    </dict>
    <key>DisplayName</key>
    <string>Gmail</string>
    <key>Enabled Dataclasses</key>
    <array>
    <string>com.apple.Dataclass.Calendars</string>
    <string>com.apple.Dataclass.Contacts</string>
    <string>com.apple.Dataclass.Mail</string>
    <string>com.apple.Dataclass.ContactsSearch</string>
    </array>
    <key>Identifier</key>
    <string>F4EBDF4A-8C1E-486E-89A8-766C1C5D8170</string>
    <key>Short Type String</key>
    <string>Exchange</string>
    <key>Sync Identifier</key>
    <string>F4EBDF4A-8C1E-486E-89A8-766C1C5D8170</string>
    <key>Type</key>
    <string>Exchange</string>
    <key>Type String</key>
    <string>Exchange ActiveSync</string>
    <key>kASAccountVersionKey</key>
    <integer>7</integer>
    </dict>
    <dict>
    <key>ASAccountEmailAddress</key>
    <string>[email protected]</string>
    <key>ASAccountHost</key>
    <string>acount2.workemail.com</string>
    <key>ASAccountMailNumberOfPastDaysToSync</key>
    <integer>0</integer>
    <key>ASAccountUseSSL</key>
    <true/>
    <key>ASAccountUsername</key>
    <string>acount2</string>
    <key>ASLastKnownProtocolVersion</key>
    <string>2.5</string>
    <key>Class</key>
    <string>ASAccount</string>
    <key>DAAccountPersistentUUID</key>
    <string>47F76882-2678-41C7-91B9-5D1AD5F76BFF</string>
    <key>DAAccountVersion</key>
    <integer>2</integer>
    <key>DATrustSettingsExceptions</key>
    <dict>
    <key>b8fa0b7f 0e99494e e3210953 21fa4725 65454492</key>
    <data>
    YnBsaXN0MDChAdICAwQFW1NTTEhvc3RuYW1lWlNIQTFE
    aWdlc3QITxAUuPoLfw6ZSU7jIQlTIfpHJWVFRJIICg8b
    JicAAAAAAAABAQAAAAAAAAAGAAAAAAAAAAAAAAAAAAAA
    Pg==
    </data>
    </dict>
    <key>DisplayName</key>
    <string>acount2</string>
    <key>Enabled Dataclasses</key>
    <array>
    <string>com.apple.Dataclass.Calendars</string>
    <string>com.apple.Dataclass.Contacts</string>
    <string>com.apple.Dataclass.Mail</string>
    <string>com.apple.Dataclass.ContactsSearch</string>
    </array>
    <key>Identifier</key>
    <string>F4EBDF4A-8C1E-486E-89A8-766C1C5D8170</string>
    <key>Short Type String</key>
    <string>Exchange</string>
    <key>Sync Identifier</key>
    <string>F4EBDF4A-8C1E-486E-89A8-766C1C5D8170</string>
    <key>Type</key>
    <string>Exchange</string>
    <key>Type String</key>
    <string>Exchange ActiveSync</string>
    <key>kASAccountVersionKey</key>
    <integer>7</integer>
    </dict>
    2009-11-07 04:09 AM
  12. drivesoslow's Avatar
    Did you change:

    <key>Identifier</key>
    <string>F4EBDF4A-8C1E-486E-89A8-766C1C5D8170</string>
    on one of the two accounts, they cannot match?
    2009-11-07 04:44 AM
  13. posrjak's Avatar
    I chanced it by one letter, not really sure what to change.
    2009-11-07 05:16 AM
  14. drivesoslow's Avatar
    All i can suggest it to convert the file to xml and try using a text editor.

    Personally I ssh'd into my phone and ran
    Code:
    plutil -convert xml1 /private/var/mobile/Library/Preferences/com.apple.accountsettings.plist
    vim /private/var/mobile/Library/Preferences/com.apple.accountsettings.plist
    and edited it through VIM.
    2009-11-07 06:01 PM
  15. lolento's Avatar
    I chanced it by one letter, not really sure what to change.
    I just used word search on my web browser....you have the same identifier on both accounts

    u didn't even change one letter, check it.
    2009-11-07 11:50 PM
  16. exalted719's Avatar
    I can confirm that this works extremely well.

    The Identifier and the SyncIdentifier both have to be modified, however.
    2009-11-08 05:54 PM
  17. drivesoslow's Avatar
    I imagine there has to be a way to hack Preferences.app to not warn about creating multiple Exchange accounts. A simple patch installed through Cydia would make this hack much easier.
    Last edited by drivesoslow; 2009-11-11 at 12:25 AM.
    2009-11-09 09:40 PM
  18. kaplansa's Avatar
    Been at this for two hours now. Grrr.

    I copied the entire block of code from the first Exchange account and have modified the following fields in the plist file (I kept adding to the fields I modded until I got a little further each time):

    ASAccountEmailAddress
    ASAccountEmailAddresses
    DAAccountPersistentUUID
    Identifier
    Sync Identifier

    Both the ASAccountEmailAddress and ASAccountEmailAddresses are my new address (exhange e-mail account #2). For DAAccountPersistentUUID, Identifier and Sync Identifier I've altered one digit in each. Both Identifier and Sync Identifier have the same modification (they're the same, but different than the pair in the first exchange account).

    When I view the account in the iPhone, it looks okay, but I have to modify my user name, server name and password the first time I enter the settings screen for this account. If I go "back" and re-enter the settings, it won't accept the changes the second time around. I have to respring at this point to enter in more changed from the GUI.

    Finally, when all looks like it's working, I click "mail" in the iPhone (I have mail sync on in settings for this new exchange account) and I get taken to the "choose your account type" screen, i.e. the screen that you get when you click "add an account" in Mail Settings, as if I didn't have any accounts set up on the iPhone at all. This is a problem.

    The only thing I don't really understand is what the point is of changing the Identifier field way at the top of the plist field, not the Identifier field actually within the Exchange account dict. I've done both - both that first Identifier and not mod it. It doesn't seem to have any effect.

    So basically, it doesn't work.

    I should mention I'm running BlainRa1n 3.1.2 with UltraSn0w on the iPhone, if it matters.
    2009-11-12 06:54 AM
  19. drivesoslow's Avatar
    Post your file so we can look at it

    Also when you change those identifiers they need to match each other.
    Last edited by drivesoslow; 2009-11-12 at 01:46 PM. Reason: Automerged Doublepost
    2009-11-12 01:46 PM
  20. Spamdumpster's Avatar
    I can confirm too that this works well. It took me a couple of tries to get the editing of the plist right, but now it works. Work and gmail - both push + work contacts + work and 2 gmail calendars. All push. All awesome.
    2009-11-13 02:37 AM
106 123 ...
LINK TO POST COPIED TO CLIPBOARD