View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002609SOGoActiveSyncpublic2014-02-20 17:002014-03-05 09:08
Assigned Toludovic 
PlatformLinuxOSCentOSOS Version6.5
Product Versionnightly v2 
Target VersionFixed in Version2.2.1 
Summary0002609: Exception when using ActiveSync with Android 4.4.2 (Email)

I receive the following in sogo.log when attempting to sync email from and android device:
EXCEPTION: <NSException: 0x7f8984890068> NAME:NSInvalidArgumentException REASON:-[NGImap4Client fetchModseqForUid:]: unrecognized selector sent to instance 0x7f89847cd2c8 INFO:(null)

I've attached a full backtrace. Let me know if I can provide more info.

Steps To ReproduceTry to sync email with activesync on android device.
Additional Informationsogo-
TagsNo tags attached.
Attached Filestxt file icon sogo.txt [^] (14,774 bytes) 2014-02-20 17:00 [Show Content]
txt file icon android_exchange.txt [^] (1,790 bytes) 2014-02-26 14:52 [Show Content]
txt file icon email-test.txt [^] (2,012 bytes) 2014-02-26 15:37 [Show Content]
patch file icon 0001-Fix-date-format-returned-by-activeSyncRepresentation.patch [^] (980 bytes) 2014-03-04 18:01 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to 0002589closedludovic Crash when using ActiveSync with Outlook 2013 

-  Notes
User avatar (0006565)
ludovic (administrator)
2014-02-25 13:11

You've upgraded SOGo but not SOPE - that's your problem.
vinyard (reporter)
2014-02-25 14:09

I'm not so sure how much more up-to-date I can get:


Above is what I've installed on my system currently, still get the same outcome. Am I missing something?
User avatar (0006567)
ludovic (administrator)
2014-02-25 14:57

Actually you are right - a commit was missing (and was just pushed). Expect updated packages soon.
vinyard (reporter)
2014-02-25 14:58
edited on: 2014-02-25 15:00

I can see that the missing method has been added a few minutes ago. [^]

I'll test when a new build becomes available.


vinyard (reporter)
2014-02-25 15:00

Beat me to it. :)
vinyard (reporter)
2014-02-26 14:52

With today's update I no longer receive the exception but exchange services on android just crash so email fails to sync. This is on Android 4.4.2, I won't be able to test it on older versions until later tonight. I've attached exchange android log although it really doesn't seem to show much.
User avatar (0006574)
ludovic (administrator)
2014-02-26 14:57

If you look at the code on Android:

                case Tags.EMAIL_DATE_RECEIVED:
                    msg.mTimeStamp = Utility.parseEmailDateTimeToMillis(getValue());

Is it possible you have a mail in your mailbox with no Date field?

IIRC, the Date field is mandatory in the AS response, but we add it conditionally in our code:

  // DateReceived
  value = [self date];
  if (value)
    [s appendFormat: @"<DateReceived xmlns=\"Email:\">%@</DateReceived>", [value activeSyncRepresentationWithoutSeparatorsInContext: context]];
vinyard (reporter)
2014-02-26 15:37

I took a quick look at the mailbox and didn't find any emails without a date field. (I'll take a more thorough look in a bit) I did test an empty mailbox which went fine but as soon as I had a message in the mailbox exchange services on android crashed again. I've attached the single email I have in this test mailbox.
User avatar (0006576)
ludovic (administrator)
2014-02-26 15:54

For testing purposes, can you try with an other AS client? Like an iPhone/iPad.

One more thing you could try is to replace, from SOGoMailObject+ActiveSync.m:

  value = [self date];
  if (value)
    [s appendFormat: @"<DateReceived xmlns=\"Email:\">%@</DateReceived>", [value activeSyncRepresentationWithoutSeparatorsInContext: context]];


  value = [self date];
  if (value)
    [s appendFormat: @"<DateReceived xmlns=\"Email:\">%@</DateReceived>", [value activeSyncRepresentationInContext: context]];

This change WILL break other AS clients, but it might work for Android v4.4.
vinyard (reporter)
2014-02-27 12:57

I've tested ActiveSync with an iPad (iOS 7.0.6) and it was successful with some minor display issues; Displays <null> instead of email address when sender name is not present and receive date for all emails is sync time instead of the correct email received date. I'll create seperate bug reports for these later. It wasn't exactly straight forward building sope & sogo from git on CentOS but I was finally able to get both to build. Once I configure it and get it running I will test the above code.
User avatar (0006581)
ludovic (administrator)
2014-02-27 13:34

That's great, thanks!

Fiddle with the code in SOGoMailObject+ActiveSync.m - activeSyncRepresentationInContext. You should have no problem enabling/disabling some properties until you find the culprit one.

Don't forget to do a make/make install in SOGo/ActiveSync to deploy the bundle and restart sogod.

casastorta (reporter)
2014-03-03 04:12


When Android sync of e-mails doesn't work, then it throws this into the Android's syslog:

I/qtaguid ( 1707): Untagging socket 38 failed errno=-22
W/NetworkManagementSocketTagger( 1707): untagSocket(38) failed with errno -22
E/INBOX[test@******.hr]( 1707): Uncaught exception in EasSyncServicejava.lang.NumberFormatException: Invalid int: "T2"
E/INBOX[test@******.hr]( 1707): Sync ended due to an exception.
vinyard (reporter)
2014-03-03 15:25
edited on: 2014-03-04 18:01

Thanks to casastorta, I took a closer look at the ReceivedDate format in the XML response.

Using the change in SOGoMailObject+ActiveSync.m provided by Ludovic works except there is an extra Hyphen being added in [NSDate activeSyncRepresentationInContext:] in NSDate+ActiveSync.m

This: (Notice the hyphen before T in the calendar format)

- (NSString *) activeSyncRepresentationInContext: (WOContext *) context
  return [self descriptionWithCalendarFormat: @"%Y-%m-%d-T%H:%M:%S.%FZ" timeZone: [NSTimeZone timeZoneWithName: @"GMT"] locale: nil];

Should be changed to this:

- (NSString *) activeSyncRepresentationInContext: (WOContext *) context
  return [self descriptionWithCalendarFormat: @"%Y-%m-%dT%H:%M:%S.%FZ" timeZone: [NSTimeZone timeZoneWithName: @"GMT"] locale: nil];

I've made this change and compiled it and now I have android syncing email through activesync.

Edit: attached small patch

User avatar (0006634)
ludovic (administrator)
2014-03-05 09:08

Nice catch! [^]

- Issue History
Date Modified Username Field Change
2014-02-20 17:00 vinyard New Issue
2014-02-20 17:00 vinyard File Added: sogo.txt
2014-02-25 10:01 Christian Mack Relationship added related to 0002589
2014-02-25 13:11 ludovic Note Added: 0006565
2014-02-25 13:11 ludovic Status new => closed
2014-02-25 13:11 ludovic Assigned To => ludovic
2014-02-25 13:11 ludovic Resolution open => won't fix
2014-02-25 14:09 vinyard Note Added: 0006566
2014-02-25 14:09 vinyard Status closed => feedback
2014-02-25 14:09 vinyard Resolution won't fix => reopened
2014-02-25 14:57 ludovic Note Added: 0006567
2014-02-25 14:58 vinyard Note Added: 0006568
2014-02-25 14:58 vinyard Status feedback => assigned
2014-02-25 15:00 vinyard Note Added: 0006569
2014-02-25 15:00 vinyard Note Edited: 0006568 View Revisions
2014-02-26 14:52 vinyard File Added: android_exchange.txt
2014-02-26 14:52 vinyard Note Added: 0006573
2014-02-26 14:57 ludovic Note Added: 0006574
2014-02-26 15:37 vinyard File Added: email-test.txt
2014-02-26 15:37 vinyard Note Added: 0006575
2014-02-26 15:54 ludovic Note Added: 0006576
2014-02-27 12:57 vinyard Note Added: 0006580
2014-02-27 13:34 ludovic Note Added: 0006581
2014-03-03 04:12 casastorta Note Added: 0006586
2014-03-03 15:25 vinyard Note Added: 0006612
2014-03-04 18:01 vinyard File Added: 0001-Fix-date-format-returned-by-activeSyncRepresentation.patch
2014-03-04 18:01 vinyard Note Edited: 0006612 View Revisions
2014-03-05 09:08 ludovic Note Added: 0006634
2014-03-05 09:08 ludovic Status assigned => closed
2014-03-05 09:08 ludovic Resolution reopened => fixed
2014-03-05 09:08 ludovic Fixed in Version => 2.2.1

Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker