Sync problem with default Android application

  • Kopano

    Hi @jsda

    Z-Push 2.3.X has been deprecated. Current Z-Push stable is 2.4.4. It’s been a while since your last post, so providing Z-Push logs might give some better insight.


  • Have you allowed for long enough sessions on your web server/firewall? Remember an active PING from a device to the server can last just shy of 1 hour. That is way more than a normal web server is configured for. Also, an active session, gathering emails can take longer than is typically allowed before the first byte is returned to the client.

    A good suggestion when debugging an issue like this is to reduce this in the main config file
    define(‘SYNC_MAX_ITEMS’, 512);

    to something like 128

  • Thank you Manfred for your continued attention to this issue.

    I have rolled back my test server for a fresh start and installed z-push from repos and confirm it is now v2.4.4.

    I also changed SYNC_MAX_ITEMS to 128 as liverpoolfcfan suggested, although since my test inbox never has more than a handful of emails, I’m guessing that makes no difference. But I do suspect some kind of timeout in the webserver or z-push configuration as being the root of this issue, just a hunch.

    My test mailbox has just 1 unread message when I configure the default Android mail app in LineageOS.

    Unfortunately I see the same behavior as before: The first synchronization seems to stall, but toggling the sync icon on the device restarts the syncronization and the inbox is synced. Then after sending a new message to the test inbox, synchronization seems to stall again. Toggling the sync icon restarts it, and all messages appear in the inbox. But then one or more will disappear, usually after viewing a message, or doing a manual refresh of the inbox.

    I have WBXML logs for all this, but they are way too verbose to post here. I can clip sections if you tell me what to include.

    FYI, I noticed each line in the log displays “… [DEBUG] [#unknown] …” where on earlier z-push versions it includes the username “… [DEBUG] [test.user] …”, not sure if that might be related to this issue or not.

    Also, I noticed the apache configuration file at /etc/apache2/conf-available/z-push.conf does not include some of the directives seen in 2.3.x, and am wondering if that is intentional or maybe an oversight.

    php_value magic_quotes_gpc off
    php_value magic_quotes_runtime off
    php_value register_globals off
    php_value short_open_tag on

    Thanks again for helping.

  • Kopano

    Hi jsda,

    you can upload the log somewhere and send me the link per PN. I’m not able to tell what to include as I don’t know what’s in the logs.

    We removed those php_value settings to support fpm in webserver config:


  • Hi Manfred, I have sent an external link via this site’s chat function, not sure if that is what you meant by ‘PN’. If there is another way to send a direct message, I can’t find it. Thanks.

  • Kopano

    Hi jsda,

    yes, by “PN” I meant chat. I’ve downloaded the logs in case you want to remove them from the download site.

    It has probably nothing to do with your issue, but did you update the Z-Push config? There are quite some log entries like:

    The configuration parameter 'USE_X_FORWARDED_FOR_HEADER' was deprecated in favor of 'USE_CUSTOM_REMOTE_IP_HEADER'. Please update your configuration.


    I don’t see anything obviously wrong in the log, only a couple of strange things.

    The device performs FolderSync quite often which is not usual (it might be due to the fact that you forced sync though).

    Are there really only 4 folders? Isn’t there deleted items or wastebasket or similar folder? Isn’t there outbox folder? Please also post your imap.conf.php contents.


  • @manfred said in Sync problem with default Android application:

    Hi enrice ,

    @enrice said in Sync problem with default Android application:

    yes, I installed from scratch, actually the version that came with ubuntu 18.4 LTS, which was 2.3.something. I did not migrate anything.

    Did you try adding z-push repositories as described at Did you make any changes to the imap backend config file?


    yes, I added them to install the latest stable version. I will again provide you with current logs.
    I also fiddled around with some config settings.

  • I gave the PHP scripts 256M, that seemed to have fixed the issue.

  • @Enrice said in Sync problem with default Android application:

    I gave the PHP scripts 256M, that seemed to have fixed the issue.

    hmm. not really. got better, but problem still remains…

  • status update: changed from Xperia Z5 Compact (Android Nougat) to Samsung Galaxy Xcover 4 (Android Oreo 8.1). Works like a charm. No problems so far whatsoever. Most email clients seem to use the same system services to do ActiveSync, so they all had the same glitch, with one exception: nine, as mentioned before. they may have their own implementation. the only thing that concerns me is, older z-push versions have been working on my old phone.

Log in to reply