[IMAP backend] Subfolders are not visible on the mobile device



  • Using CentOS 7.8.2003 with z-push 2.5.2 packages installed from http://repo.z-hub.io/z-push:/final/RHEL_7
    Tested with and iPad, Android on LG G6 (Gmail + the native LG email app) and Windows 10 mail, same behaviour on all. The IMAP server is Dovecot plus:

    • In /etc/z-push/imap.conf.php I’m using “define(‘IMAP_FOLDER_PREFIX’, ‘INBOX’);”
    • In /etc/z-push/combined.conf.php I have “‘delimiter’ => ‘.’,”

    Given the folder structure “INBOX.Folder1.Subfolder1”, I see the inbox and Folder1 in the mobile client interface, but I don’t see Subfolder1.
    A typical IMAP session returns the following for LIST and LSUB commands":

    • CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY LITERAL+ NOTIFY METADATA SPECIAL-USE QUOTA ACL RIGHTS=texk
      . OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY LITERAL+ NOTIFY METADATA SPECIAL-USE QUOTA ACL RIGHTS=texk] Logged in
      . LIST “” *
    • LIST (\HasChildren) “.” INBOX
    • LIST (\HasChildren \UnMarked) “.” INBOX.Folder1
    • LIST (\HasNoChildren \UnMarked) “.” INBOX.Folder1.Subfolder1
    • LIST (\HasNoChildren \UnMarked \Archive) “.” INBOX.Archives
    • LIST (\HasNoChildren \UnMarked \Trash) “.” INBOX.Trash
    • LIST (\HasNoChildren \UnMarked \Drafts) “.” INBOX.Drafts
    • LIST (\HasNoChildren \UnMarked \Sent) “.” INBOX.Sent
    • LIST (\HasNoChildren \UnMarked \Junk) “.” INBOX.Spam
      . OK List completed (0.002 + 0.000 + 0.001 secs).
      . LSUB “” *
    • LSUB (\Archive) “.” INBOX.Archives
    • LSUB () “.” INBOX.Folder1
    • LSUB () “.” INBOX.Folder1.Subfolder1
    • LSUB (\Sent) “.” INBOX.Sent
    • LSUB (\Junk) “.” INBOX.Spam
    • LSUB (\Drafts) “.” INBOX.Drafts
    • LSUB (\Trash) “.” INBOX.Trash
      . OK Lsub completed (0.001 + 0.000 secs).
      . logout
    • BYE Logging out
      . OK Logout completed (0.001 + 0.000 secs).

    How can I configure z-push to be able to see the entire folder structure on the mobile devices?


  • Kopano

    Hi @burnley,

    did you check z-push.log? You might need to set the log level to WBXML to see what’s going on with the folders.

    Manfred



  • Hi @Manfred, thanks for replying. I’ve added a test user to specialLogUsers array and used Gmail on Android to test the behaviour. How can I share privately the WBXML data for that user?



  • @Manfred said in [IMAP backend] Subfolders are not visible on the mobile device:

    Hi @burnley,

    did you check z-push.log? You might need to set the log level to WBXML to see what’s going on with the folders.

    Just as a test, I went and commented out in /usr/share/z-push/lib/core/changesmemorywrapper the following code:

                    // The Zarafa/Kopano HierarchyExporter exports all kinds of changes for folders (e.g. update no. of unread messages in a folder).
                    // These changes are not relevant for the mobiles, as something changes but the relevant displayname and parentid
                    // stay the same. These changes will be dropped and are not sent!
                    if ($folder->equals($this->GetFolder($folder->serverid), false, true)) {
                        ZLog::Write(LOGLEVEL_DEBUG, sprintf("ChangesMemoryWrapper->ImportFolderChange(): Change for folder '%s' will not be sent as modification is not relevant.", $folder->displayname));
                        return false;
                    }
    
                    // check if the parent ID is known on the device
                    if (!isset($folder->parentid) || ($folder->parentid != "0" && !$this->GetFolder($folder->parentid))) {
                        ZLog::Write(LOGLEVEL_DEBUG, sprintf("ChangesMemoryWrapper->ImportFolderChange(): Change for folder '%s' will not be sent as parent folder is not set or not known on mobile.", $folder->displayname));
                        return false;
                    }
    
    

    After the change I can see all the folders and their subfolders, which look like this in an IMAP session:

    A01 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY LITERAL+ NOTIFY METADATA SPECIAL-USE QUOTA ACL RIGHTS=texk] Logged in
    A01 NAMESPACE
    * NAMESPACE (("INBOX." ".")) (("OtherUsers." ".")) (("Public." "."))
    A01 OK Namespace completed (0.001 + 0.000 secs).
    A01 LIST "" *
    * LIST (\HasChildren) "." INBOX
    * LIST (\HasChildren \UnMarked) "." INBOX.Folder2
    * LIST (\HasChildren \UnMarked) "." INBOX.Folder2.Subfolder2
    * LIST (\HasNoChildren \UnMarked) "." INBOX.Folder2.Subfolder2.Subfolder2_1
    * LIST (\HasChildren \UnMarked) "." INBOX.Folder1
    * LIST (\HasChildren \UnMarked) "." INBOX.Folder1.Subfolder1
    * LIST (\HasNoChildren \UnMarked) "." INBOX.Folder1.Subfolder1.Subfolder1_1
    * LIST (\HasNoChildren \UnMarked \Trash) "." INBOX.Trash
    * LIST (\HasNoChildren) "." INBOX.Templates
    * LIST (\HasNoChildren \UnMarked \Junk) "." INBOX.Spam
    * LIST (\HasNoChildren \UnMarked \Sent) "." INBOX.Sent
    * LIST (\HasNoChildren \UnMarked \Drafts) "." INBOX.Drafts
    * LIST (\HasNoChildren \UnMarked \Archive) "." INBOX.Archives
    A01 OK List completed (0.002 + 0.000 + 0.001 secs).
    A01 LSUB "" *
    * LSUB () "." INBOX.Folder1
    * LSUB () "." INBOX.Folder1.Subfolder1
    * LSUB () "." INBOX.Folder1.Subfolder1.Subfolder1_1
    * LSUB () "." INBOX.Folder2
    * LSUB () "." INBOX.Folder2.Subfolder2
    * LSUB () "." INBOX.Folder2.Subfolder2.Subfolder2_1
    * LSUB (\Sent) "." INBOX.Sent
    * LSUB (\Junk) "." INBOX.Spam
    * LSUB (\Drafts) "." INBOX.Drafts
    * LSUB (\Trash) "." INBOX.Trash
    * LSUB (\Archive) "." INBOX.Archives
    A01 OK Lsub completed (0.001 + 0.000 secs).
    


  • @burnley said in [IMAP backend] Subfolders are not visible on the mobile device:

    Hi @Manfred, thanks for replying. I’ve added a test user to specialLogUsers array and used Gmail on Android to test the behaviour. How can I share privately the WBXML data for that user?

    More tests :)

    1. LG G6 H870 phone using the native LG email app, user-agent “Android-LG-H870DS/8.0.8”, I see all folders and subfolders and all the emails appear to be syncing properly.
    2. Gmail app on both LG phone as well as a Lenovo tablet displays all folders, however for some reason all emails in Inbox become invisible on the phone after the initial sync. Emails in all other folders are still being displayed.
    3. iPad with iOS 13.4.1 using the native email app: the second & third level subfolders are still missing, only first level folders are being displayed and synced.

  • Kopano

    Hi @burnley,

    you can upload the logs somewhere and send me the link per PN.

    However the imap backend is largely community contribution and I wasn’t very involved in its latest development. Due to the fact that it works on some devices and not on the others, it might be some device specific issue.

    Manfred



  • @Manfred said in [IMAP backend] Subfolders are not visible on the mobile device:

    Hi @burnley,

    you can upload the logs somewhere and send me the link per PN.

    However the imap backend is largely community contribution and I wasn’t very involved in its latest development. Due to the fact that it works on some devices and not on the others, it might be some device specific issue.

    Manfred

    Messaged you for the WBXML output, thanks.


Log in to reply