View Issue Details

IDProjectCategoryView StatusLast Update
0003269SOGoActiveSyncpublic2015-07-22 13:19
Reporterdaniel.colchete Assigned Toludovic  
Status resolvedResolutionfixed 
PlatformGoogle AndroidOSLollipopOS Version5.0.2
Product Version2.3.0 
Fixed in Version2.3.1 
Summary0003269: Android Lollipop doesn't like non-root Trash, Draft and Sent folders on Email

This is the second bug on my list to make SOGo work with Android Lollipop here. The first is at

Here on my server we are using Dovecot 2.2.18, but a few years ago we migrated from courier-imap. Following the procedure defined at [^] we activated a default IMAP namespace so that users won't have to re-sync terabytes of mailboxes all over again. It worked.

I found out the Android Lollipop doesn't like when mail special folders (ActiveSync types 2 to 6) are all inside a default namespace. The Email app won't show most of the mail and Contacts and Calendars won't sync anything.

Fixing this bug was one of the necessary steps I had to make here to make ActiveSync work on Lollipop in my case.

Steps To Reproduce

1 - Set up a new Dovecot with a default namespace enabled.
2 - Set up a new SOGo with EAS enabled.
3 - Apply the patch at
4 - Wipe an Android Lollipop device (I used the Android Virtual Device Manager)
5 - Set up an account and wait for it to finish syncing.

Additional Information

This is the patch I created to test this:

diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m
index 83314be..e82ec95 100644
@@ -872,11 +879,12 @@ static BOOL debugOn = NO;
type = [[folderMetadata objectForKey: @"type"] activeSyncFolderType];
parentId = @"0";

  • if ([folderMetadata objectForKey: @"parent"])
  • if (([folderMetadata objectForKey: @"parent"])&&((type <2)||(type > 6)))
    parentId = [NSString stringWithFormat: @"mail/%@", [[imapGUIDs objectForKey: [NSString stringWithFormat: @"folder%@", [[folderMetadata objectForKey: @"parent"] substringFrom
    name = [[name pathComponents] lastObject];
  • name = [[name pathComponents] lastObject];

    // Decide between add and change
    if ([cachedGUIDs objectForKey: [imapGUIDs objectForKey: nameInCache]])

It forces everything back to to the root level. User defined folders at kept where they should be.

TagsNo tags attached.




2015-06-25 09:09

reporter   ~0008675

I was thinking if we could add support to IMAP default namespaces and completely jump to inside the INBOX. namespace upfront on mail servers that did But this change is too important for me to even try it.



2015-06-25 09:12

reporter   ~0008676

Thread on mailing list:



2015-06-25 09:46

reporter   ~0008677

To make it work another work-around is also necessary. Even after the patch we are still sending something wrong to Android and it causes it to send a wrong SyncKey. I sent the full description of this other problem to the mailing list, but here is just the work-around part:

Moving on now there is still the invalid SyncKey problem. I have found a work-arround it. After the creation of the accountm wait for it to finish syncing, uncheck sync of Mail, Contacts and Calendar, and then check them again, one at a time, waiting for it to finish syncing. Usually Calendar will take a long time to sync while the other ones will be fast.



2015-06-25 11:43

reporter   ~0008678

Complete email on the mailing list with both bugs and workarround description plus logs and screenshots:



2015-07-22 13:19

administrator   ~0008744

Issue History

Date Modified Username Field Change
2015-06-25 09:07 daniel.colchete New Issue
2015-06-25 09:09 daniel.colchete Note Added: 0008675
2015-06-25 09:12 daniel.colchete Note Added: 0008676
2015-06-25 09:46 daniel.colchete Note Added: 0008677
2015-06-25 11:43 daniel.colchete Note Added: 0008678
2015-07-22 13:19 ludovic Note Added: 0008744
2015-07-22 13:19 ludovic Status new => resolved
2015-07-22 13:19 ludovic Fixed in Version => 2.3.1
2015-07-22 13:19 ludovic Resolution open => fixed
2015-07-22 13:19 ludovic Assigned To => ludovic