IMAP Followup flag with BackendCombined



  • I’ve setup a working combined backend but struggling with the followup-flags. When I set the followup flag from an activesync client (app on Android phone or outlook), it reaches my IMAP backend. A change in the flag status will be reflected in either roundcube, thunderbird or some other IMAP client. The other way around doesn’t work however. Flag changes made on the IMAP side will not be downloaded to ActiveSync devices.

    I think I may have some error in the ‘folderbackend’ config, but no idea what. Anyone up for some tips?

    39     public static function GetBackendCombinedConfig() {
    40         //use a function for it because php does not allow
    41         //assigning variables to the class members (expecting T_STRING)
    42         return array(
    43             //the order in which the backends are loaded.
    44             //login only succeeds if all backend return true on login
    45             //sending mail: the mail is sent with first backend that is able to send the mail
    46             'backends' => array(
    47                 'i' => array(
    48                     'name' => 'BackendIMAP',
    49                 ),
    50                 'd' => array(
    51                     'name' => 'BackendCardDAV',
    52                 ),
    53                 'c' => array(
    54                     'name' => 'BackendCalDAV',
    55                 ),
    56             ),
    57             'delimiter' => '/',
    58             //force one type of folder to one backend
    59             //it must match one of the above defined backends
    60             'folderbackend' => array(
    61                 SYNC_FOLDER_TYPE_INBOX => 'i',
    62                 SYNC_FOLDER_TYPE_DRAFTS => 'i',
    63                 SYNC_FOLDER_TYPE_WASTEBASKET => 'i',
    64                 SYNC_FOLDER_TYPE_SENTMAIL => 'i',
    65                 SYNC_FOLDER_TYPE_OUTBOX => 'i',
    66                 SYNC_FOLDER_TYPE_TASK => 'c',
    67                 SYNC_FOLDER_TYPE_APPOINTMENT => 'c',
    68                 SYNC_FOLDER_TYPE_CONTACT => 'd',
    69                 SYNC_FOLDER_TYPE_NOTE => 'c',
    70                 SYNC_FOLDER_TYPE_JOURNAL => 'c',
    71                 SYNC_FOLDER_TYPE_OTHER => 'i',
    72                 SYNC_FOLDER_TYPE_USER_MAIL => 'i',
    73                 SYNC_FOLDER_TYPE_USER_APPOINTMENT => 'c',
    74                 SYNC_FOLDER_TYPE_USER_CONTACT => 'd',
    75                 SYNC_FOLDER_TYPE_USER_TASK => 'c',
    76                 SYNC_FOLDER_TYPE_USER_JOURNAL => 'c',
    77                 SYNC_FOLDER_TYPE_USER_NOTE => 'c',
    78                 SYNC_FOLDER_TYPE_UNKNOWN => 'i',
    79             ),
    80             //creating a new folder in the root folder should create a folder in one backend
    81             'rootcreatefolderbackend' => 'i',
    82         );
    83     }
    

    One more thing: what is the ‘delimiter’ key? I use a dot (.) in my IMAP backend as the directory separator.



  • Well would love to help you guys out and improve this. I’d like to raise an issue on github. I’m a PHP developer so I think I could be of some use here, as long as you guys offer some guidance on the way Z-push is structured and the activesync protocol, since those are not my areas of expertise at all.



  • I believe there is some discepancy between the IMAP rfc and the way it’s implemented in ‘activesyncy’ clients, since the IMAP RFC talks of a ‘flag’ as being either present or non-present (in the list of flags or not), while clients like outlook set a ‘followup’ flag and upon clicking that flag again they don’t remove the flag but rather mark it ‘followed up’. Right-clicking it lets you in fact remove the flag after it has been followed up. Still, this doesn’t actually do anything on the IMAP server it seems.

    So this is an interesting line, don’t remember the log mentioning doing anything to the flag.



  • Since I can’t open a github issue, I’ll discuss the matter here. I can confirm that the flag is correctly retrieved here. Just not sent correctly to activesync devices


  • Kopano

    @Luke1982 said in IMAP Followup flag with BackendCombined:

    Since I can’t open a github issue

    Actually the leading ticket system is a Jira installation hosted at https://jira.z-hub.io/secure/Dashboard.jspa. The development flow is explained at https://wiki.z-hub.io/display/ZP/Development+guidelines.

    I am sure the z-push developers will get to your question once they find the time.



  • @fbartels Cool, didn’t know that. Will do.


  • Kopano

    Hi @Luke1982,

    did you create https://jira.z-hub.io/browse/ZP-1561?

    The IMAP backend was a community contribution and I’m not very familiar with it. I’m also not very familiar with the IMAP flags.

    As far as I can see setting the flags coming from the IMAP server happens here: https://github.com/Z-Hub/Z-Push/blob/master/src/backend/imap/imap.php#L1243. Check https://github.com/Z-Hub/Z-Push/blob/master/src/lib/syncobjects/syncmailflags.php which properties are available for the flags. Maybe some of them is missing and that’s why device doesn’t process it correctly.

    Manfred



  • Hi @Manfred

    Yes, that’s the issue I created. Thanks for the input, very helpful. I’m also not very familiar with IMAP so this is a learning experience for me as well but let me try some debugging and see what happens.

    I tried logging WBXML, but since that’s binary logging it isn’t of much use, Any idea how to decode it? I’d like to see what the eventual output to the device is.


  • Kopano

    Hi @Luke1982,

    @Luke1982 said in IMAP Followup flag with BackendCombined:

    I tried logging WBXML, but since that’s binary logging it isn’t of much use, Any idea how to decode it? I’d like to see what the eventual output to the device is.

    how so? The WBXML data is in clear text in z-push.log if you set LOGLEVEL to LOGLEVEL_WBXML in the main Z-Push config.php.

    Manfred


Log in to reply