When a Nokia client running MailForExchange opens a new email, on the next sync request it will pass over the Change request for both 'Read' and 'Flag' - this is similar for every phone - except most will not include the Flag status if it did not change.
However, if the sync response does not confirm these changes back to the Nokia client it will not update it's internal server state. Thus, on the next sync request it will once again pass over the Read/Flag change. This will continue indefinitely - up until the point where a sync request informs the client that the item has been removed (whether deleted or past the sync window)
The fix for this - which also has no adverse affects on any other client - is to reflect the changes back out to the phone. On receiving the changes back from the server - the Nokia updates it's own internal view of the server.
See below for a log generated from a sync post reading a new mail - using the as12.1 server. Note the WBXML response back to the device includes the same modify Read/Flag request as the incoming request from the phone.
For non-Nokia phones, it is more normal to receive only the Read flag - for some reason the Nokia sends both Flag status and Read flags together always.
Vincent
- Code: Select all
... START Setup { userid = myUser; devid = IMEI.............3981; protocolversion = 12.1; useragent = NokiaE71/3.00(73)MailforExchange }
... END Setup { 83 Folders Loaded }
... POST cmd: Sync
... Statemachine _devid initialized with imei.............3981 for user myUser
... Statemachine _devid initialized with imei.............3981 for user myUser
... I <Synchronize>
... I <Folders>
... I <Folder>
... I <SyncKey>
... I {41356b90-e0f9-46e5-9a0c-ed8789987c89}4
... I </SyncKey>
... GetSyncState: File /var/www/html/as12.1/state/imei.............3981/{41356b90-e0f9-46e5-9a0c-ed8789987c89}4 read
... GetSyncState: Size of syncstate is 7854
... GetSyncState: File /var/www/html/as12.1/state/imei.............3981/mi{41356b90-e0f9-46e5-9a0c-ed8789987c89}4 read
... GetSyncState: Size of syncstate is 13291
... I <FolderId>
... I f2
... I </FolderId>
... I <DeletesAsMoves/>
... I <GetChanges/>
... I <MaxItems>
... I 50
... I </MaxItems>
... I <Options>
... I <FilterType>
... I 2
... I </FilterType>
... I <AirSyncBase:BodyPreference>
... I <AirSyncBase:Type>
... I 1
... I </AirSyncBase:Type>
... I <AirSyncBase:TruncationSize>
... I 3072
... I </AirSyncBase:TruncationSize>
... I </AirSyncBase:BodyPreference>
... I <Conflict>
... I 1
... I </Conflict>
... I </Options>
... I <Perform>
... HandleSync: Sync folder:Email
... HandleSync: FilterTypes Perform: 2
... I <Modify>
... I <ServerEntryId>
... I 96087
... I </ServerEntryId>
... I <Data>
... I <POOMMAIL:Read>
... I 1
... I </POOMMAIL:Read>
... I <POOMMAIL:Flag/>
... I </Data>
... I </Modify>
... START ImportMessageFlag - { id=96087; flag=<object> }
... START SetMessageFlag (folderid: 'f2' id: '96087' flags: '' [Clear-0/'' - Completed-1 - FollowUp-2])
... Clearing Flag
... END SetMessageFlag { true }
... END ImportMessageFlag { true }
... START SetReadFlag { folderid = f2; id = 96087; flags = 1 [Read-1 or Unread-0] }
... END SetReadFlag { true }
... I </Perform>
... HandleSync: Processed 1 incoming changes
... I </Folder>
... setSyncState: Try writing to file /var/www/html/as12.1/state/imei.............3981/mi{41356b90-e0f9-46e5-9a0c-ed8789987c89}4
... setSyncState: Size of syncstate is 13291
... I </Folders>
... I </Synchronize>
... HandleSync: Not a partial sync. Removing SyncCache[synckey] from collection f2
... HandleSync: Not a partial sync. Removing SyncCache[synckey] from collection f5
... HandleSync: Not a partial sync. Removing SyncCache[synckey] from collection f10
... HandleSync: Not a partial sync. Removing SyncCache[synckey] from collection f7
... HandleSync: Not a partial sync. Removing SyncCache[synckey] from collection f15
... HandleSync: Adding SyncCache[synckey] from collection f2
... HandleSync: All SyncKeys got confirmed. We continue here...
... setSyncState: Try writing to file /var/www/html/as12.1/state/imei.............3981/mi{41356b90-e0f9-46e5-9a0c-ed8789987c89}4
... setSyncState: Size of syncstate is 13291
... HandleSync: SyncStatus is 1 hbinterval is
... HandleSync: dataavailable: No dataimported: Yes
... Looking for collections not having the getChanges option being set
... HandleSync: New Synckey generated because importedchanges: 1 getchanges: 1 initialsync:
... O <Synchronize>
... O <Folders>
... O <Folder>
... O <SyncKey>
... O {41356b90-e0f9-46e5-9a0c-ed8789987c89}5
... O </SyncKey>
... O <FolderId>
... O f2
... O </FolderId>
... O <Status>
... O 1
... O </Status>
... HandleSync: FilterType GetChanges : 2 0
... HandleSync: Messageclass for Export: Email
... START GetMessageList { folderid = f2; cutoffdate = 1342952283; virtual = 0; offset = 0 }
... END GetMessageList MESSAGES { count = 81 }
... HandleSync: Changecount vs maxitems: 0 50
... HandleSync: After Exporting Changes we still have following array_rf in importer: Array
(
[0] => 96087
)
... O <Perform>
... O <Modify>
... O <ServerEntryId>
... O 96087
... O </ServerEntryId>
... O <Data>
... O <POOMMAIL:Read>
... O 1
... O </POOMMAIL:Read>
... O <POOMMAIL:Flag/>
... O </Data>
... O </Modify>
... HandleSync: After manual export of read and flag changes we still have following array_rf in importer: Array
(
)
... O </Perform>
... O </Folder>
... setSyncState: Try writing to file /var/www/html/as12.1/state/imei.............3981/{41356b90-e0f9-46e5-9a0c-ed8789987c89}5
... setSyncState: Size of syncstate is 7858
... HandleSync: Current Synckey: {41356b90-e0f9-46e5-9a0c-ed8789987c89}4 New Synckey: {41356b90-e0f9-46e5-9a0c-ed8789987c89}5
... setSyncState: Try writing to file /var/www/html/as12.1/state/imei.............3981/mi{41356b90-e0f9-46e5-9a0c-ed8789987c89}5
... setSyncState: Size of syncstate is 13291
... O </Folders>
... O </Synchronize>
... HandleSync: Answer prepare duration run 0.17331314086914
... HandleSync: Sync runtime = 1.1594181060791
... GZip Results: Original Size 87 / Compress Size 101 byte(s) --> Send uncompressed data
07/25/12 11:18:05 [7121] verifyCommunication: Device should have the data!
07/25/12 11:18:05 [7717] Header Connection aborted :no
07/25/12 11:18:05 [7717] Header Connection status :0
