|
2014-07-08
, 19:34
|
Guest |
Posts: n/a |
Thanked: 0 times |
Joined on
|
#2
|
The Following User Says Thank You to For This Useful Post: | ||
|
2014-07-08
, 20:14
|
Community Council |
Posts: 4,920 |
Thanked: 12,867 times |
Joined on May 2012
@ Southerrn Finland
|
#3
|
hmm good job!
Did you try this with fcron?
(https://openrepos.net/content/nieldk/fcron)
The Following User Says Thank You to juiceme For This Useful Post: | ||
|
2014-07-08
, 20:19
|
|
Posts: 2,448 |
Thanked: 9,523 times |
Joined on Aug 2010
@ Wigan, UK
|
#4
|
|
2014-07-08
, 21:00
|
Community Council |
Posts: 4,920 |
Thanked: 12,867 times |
Joined on May 2012
@ Southerrn Finland
|
#5
|
Isn't it possible to use Buteo for the scheduling of the DBus calls, thus removing the requirement to install cron? Further still, isn't the email sync scheduling determined by a Buteo config, which can simply be edited?
|
2014-07-18
, 07:39
|
Community Council |
Posts: 4,920 |
Thanked: 12,867 times |
Joined on May 2012
@ Southerrn Finland
|
#6
|
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/100000/dbus/user_bus_socket" /bin/dbus-send --session --type=method_call --print-reply --dest=com.meego.msyncd /synchronizer com.meego.msyncd.startSync string:'syncemail-2' > /dev/null 2>&1
|
2014-07-18
, 09:07
|
Community Council |
Posts: 685 |
Thanked: 1,235 times |
Joined on Sep 2010
@ Mbabane
|
#7
|
The Following User Says Thank You to sicelo For This Useful Post: | ||
|
2014-07-18
, 10:30
|
Community Council |
Posts: 4,920 |
Thanked: 12,867 times |
Joined on May 2012
@ Southerrn Finland
|
#8
|
|
2014-10-26
, 17:43
|
Community Council |
Posts: 4,920 |
Thanked: 12,867 times |
Joined on May 2012
@ Southerrn Finland
|
#9
|
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/100000/dbus/user_bus_socket" /bin/dbus-send --session --type=method_call --print-reply --dest=com.meego.msyncd /synchronizer com.meego.msyncd.startSync string:'syncemail-3' > /dev/null 2>&1
|
2015-04-17
, 19:59
|
Community Council |
Posts: 4,920 |
Thanked: 12,867 times |
Joined on May 2012
@ Southerrn Finland
|
#10
|
Background:
The default email synchronization framework for Sailfish is pretty barebones, you could say it sucks like a hoover in fact.
For IMAP accounts the only thing you can do is to set up synchronization interval, and that's it.
I have been told it is a bit better for Exchange accounts, there you can set at least busy-hour interval and off-hour interval separately.
This is way too primitive, what it means is that I'd need to suffer continuous email pings thru the night, or else manually turn it off at the end of the day.
What I want to do, is something like this, for example:
Well, that does sound like job for cron, right?
Solution:
I have built and packaged the basic Vixie Cron that's been adapted to Sailfish by Zeamoceq. It's probably the simplest cron version, no extra niceties&features like on fcron but it does the job.
Now, normally I use that for backup syncing and setting up remote connections to my device, and adding email sync to crontab was no brainer.
What caused me eornomous problems was how to get cron to signal the mail client that it should do an update... I tried various ways of DBUS messaging to emulate the swipe gesture on the email UI but no avail
Thanks to @w00t, @special & @chem|st, who helped me with this!
I had gone at it from the wrong end of things, it appears that the correct way is to send DBUS message to buteo, which is the synchronization framework on Sailfish. Buteo will then trigger the sync on the email client...
This is the message to sync email:
Now, my special email synchronizing schedule can be reduced to 3 lines in my crontab:
The installable application:
That's the crond & crontab, of course. Here is the SRPM for it
Now, why do I distribute a SRPM, wouldn't a RPM be better, huh??
Absolutely not. I have an ideological aversion to distributing binary programs, unless I really really have to. Installing unknown binary packages to your system is not something I encourage.
Hence the SRPM.
Besides, building well made SRPM's is just as easy & quick as installing a binary RPM, and it gives you the chance to peek at the source, to verify yourself that the beast really is what it claims to be.
So, for the first'timers to source package installation, this is how you do it:
That's it, now you have the RPM and you can install it as root:
Now there's some dependencies you need on your device, but nothing too drastic. You need to install the following packages:
Stability & battery usage:
I have now used this email sync method for a full week, and it works without a hitch.
I have found that this does not really increase battery consumption of the device noticeably. Most of the time cron is sleeping on a socket, waiting for a system timer wakeup event to happen.
My biggest battery eater is always the GPS track recorder I use few hours every day. If I don't use that, I have maybe 77% left after a day of maybe 18 hours active use (few phonecalls, SMS, emails, browsinf TMO, etc...)
If I use 2 hours of GPS logging in addition to that, battery could be down to 60% in the evening when I go to sleep...
You need to keep the email app open, of course, for this to work. If you close your email, synchronization event does not start it, but rather passes harmlessely.