HowTo: temporarily fix the erratic email syncing problem [released]
UPDATE 2014/02/05:
IMPORTANT: manually setting the update interval by using ag-tool
for email accounts introduces a whole range of new problems (see VDVsx' answer below), so it is better to stay away from it. If you have manually changed the update interval, either change it back to 0, or delete and re-create the account.
UPDATE 2014/01/08:
the email syncing problem seems to be caused by the system not waking up from suspend to check for new emails. Have a look at this for details: Overzealous suspend everything watchdog (workaround included). The discussion is about sshd responsiveness, but it looks like the email syncing problem has the same root cause.
The advice from there is to change the suspend policy to "early". Make sure you read the entire thread and understand it before playing with it.
I can confirm it works, but use it with great care. The most visible side effect is increased battery consumption during suspend, but there might be other unforeseen effects. Battery life is still much better compared to having tohd.service running, and for my usage patterns it is comparable to N9.
If you can live with the current situation, I'd advice you wait for a proper fix, and vote up all questions related to email client problems.
The initial guide can still be used to fine tune the email checking interval, but it will still not work properly while the device is in suspend mode with the stock configuration.
UPDATE 2014/01/05:
this method may improve the sync behavior in certain conditions, however it is not a general solution. I will do another update with more details in the next days.
----------
Here's a simple way of fixing the missed syncs for the email client. You need to activate the developer mode and get into the terminal.
1. Switch to root (ie. devel-su
)
2. Install ag-tool:
pkcon install libaccounts-glib-tools
If it fails, try to activate mer-tools repository before running it again:
ssu er mer-tools
pkcon refresh
3. Exit from su (or Ctrl-D
)
4. Get the account ID:
ag-tool list-accounts
You will get a list of the accounts, with the ID in the first column. You will need the ID in the following steps. I will use 3 as a demo value.
5. Verify the current settings (not necessary):
NOTE: this assumes an imap4 account, but it will probably work in the same fashion for pop3
ag-tool list-settings 3 | grep checkInterval
You will get something like:
imap4/checkInterval = 0
6. Set the interval to how many minutes you want, in this example 5 is used:
ag-tool update-service 3 email int:imap4/checkInterval=5
7. Enjoy getting notifications for new emails every 5 minutes ;)
Unfortunately, there's still a problem: you will only get a notification (light and sound) for the first batch of new emails. Subsequent emails will be visible in the notification screen, but the phone will not notify you at all. It will start notifying again after you clear the current notifications.
I am still waiting for the proper solution and, more importantly, for the IMAP IDLE support. These settings (both check interval and IMAP IDLE) should be available per account.
if i do a grep on that interval afterwards, it still says 0 ... didn't receive an error message though... should it be 5 on grep after the update-service command?
egnat69 ( 2013-12-28 19:25:09 +0200 )editegnat, if you are using a Google account (as opposed to IMAP), the command in step 6 has to be changed to this:
ag-tool update-service 3 google-gmail int:imap4/checkInterval=5
email is replaced by google-gmail.
clau ( 2013-12-29 21:23:57 +0200 )editYou might also need to reboot, for the changes to take effect.
clau ( 2013-12-30 11:51:14 +0200 )editI followed your suggestions and set successfully the imap4/checkInterval=5 for my IMAP mail account but syncing is still not every 5 minutes but every "sometimes" (half an hour, hour or even two hours...). So I'm waiting for a real fix... Anyway: IMAP IDLE would be my prefered choice.
Alexander ( 2014-01-02 15:55:32 +0200 )editYou are right, it still does not work as expected. There seems to be a deeper issue with the suspended state of the phone, in which the email app does not wake up to check for new emails. This definitely needs to be addressed officially.
For some details, check this link.
clau ( 2014-01-02 16:05:34 +0200 )edit