I’ve been working on a small information sharing project, and it was a bit tricky before I figured out how to get the things playing nice with each other. I have three devices of various platforms I want to use, and I want to have access to the same information across all three. The information I want to share between devices is
The files should also be available to other people I want to share them with.
Due to deals I have access to, I am using MS Office365 as mail server (I’ve run my own mail server from time to time – it’s much too time consuming for two user accounts). For file sharing I use ownCloud (community edition) and use it mainly for backup of my more important stuff – it’s hosted on Linode and run from a docker image.
The devices I want to keep synchronized are
I wanted to keep the laptop as “pure” KDE as possible reasoning that as KDE has always been my prefered desktop environment (besides Cinnamon) and as Suse is one of the main contributors to KDE this should work here if anywhere.
This is the (not entirely easy) story on getting all this working.
I’ve used Owncloud before, intoducing it as the Dropbox substitute at a previous place of work (because we had no control of where the files were kept, which was important at the time). It has a lot of features for file sharing, although maybe not the extreme simplicity of Dropbox – but it’s getting there. OwnCloud comes with it’s own client for most operating systems. To synchronize ownCloud to/from Windows just install the Windows client and it all “just works”. For Android there are a few offerings, the one I’ve been using with least hassle is oCloud for ownCloud. Naturally the main feature is not that it synchs (it would kill any mobile phone I’d use, but gives you access to the files). For OpenSuse there was a bit a struggle as installing the ownCloud provided client openSuse Tumbleweed client is depending on a library – libicui18n.so.suse63.1 , that, being what Tumbleweed is, has since been superceded by a newer one.
Rather than trying to symlink the new library to the name of the older, I got the suggestion to use a new repository for Tumbleweed. Then the client installed fine, and getting the synchronization to work was the usual no-brainer. But I also wanted to use ownCloud directly from the file manager and various File-Save/Open dialogs. Fortunately KDEs Dolphin file manager has the built in ability to add network drives
and you may add a WebDAV connection using the ownCloud connection string broken up in the appropriate pieces
and once configured correctly you have access to ownCloud both in the file manager and from the dialog boxes. Even better, Krusader – the KDE native dual-pane filemanager (like “Total commander” or “Midnight commander”) takes the webdav entries and saves them as bookmarks, and if you use KWallet, it already knows the password. And yes I know Dolphin also does dual-pane, but I like Krusader.
oCloud client
The Tumbleweed repository used
So that was the easy part. Now things get fiddly.
I didn’t want to add non-KDE pieces if this could be avoided. The problem is, as users who try to use O365 as a mailserver with Kontact is KMail. It is supposed to be able to connect to O365 from the “internal” setup, but this rarely, if ever works it seems. There are many, many frustrated and more or less desperate posts to be found on the internet about how hopelessly broken KMail is in regards to O365. Which is frustrating the heck out of users because
Which is less than helpful because of a and b above. What you need to do is to forget about the automated setup, and open akonadiconsole to manually create the configuration to O365.
Using these connectors I’ve been able to get mail access from the O365 server. Unfortunately sending mail is another matter, and I have never gotten it work reliably over time. Which is a problem … There are also – which I found equally troublesome problems with adding calendar events using these connectors. Fortunately there is as solution to save the day, although you lose the integration to other O365 services – IMAP.
Configuring these according the standard support page works nicely. So by this point, I had email working across Windows (standard Outlook client) and Linux (Kontact/Kmail). For Android, there is an Outlook client which works as expected.
It kindof did at this point. To say it works flawlessly, is stretching it a bit. The setup worked for a day or two, then KMail stopped updating mail. Hitting Check Mail in the client did nothing. Going into the, by now, familiar Akonadiconsole showed that the IMAP service had stopped with the error “Server not found”. Restarting the service and then doing a “Synch all” got everything flowing again. Untill the next day. When it had stopped. It got old and frustrating quickly.
The solution (until this problem is fixed) is to do a miniscript
#!/bin/bash
akonadictl fsck
akonadictl vacuum
and save it to your personal bin folder. The script, if executed manually, fixes the problem. This does some mailbox housekeeping and makes everything fine and dandy. “Fsck checks for items that are referenced in Akonadi but no longer present in the sources (e.g. deleted mails), i.e. moves them to lost-found. Vacuum cleans out those entries”.
Running this manually every day also got pretty old and frustrating very quickly. So add the script to your KDE autostart and have it run everyday. It will add next to nothing in boot time.
NOW, we are happy – Kontact updates the Linux mailbox instance properly.
During the setup of the mail functionality I noticed that calendars were not as easy to get to grips with as you’d like. Updating the O365 calendar from Linux where not working reliably. I needed a reliable way to use a calendar across all three platforms. Luckily I knew that ownCloud does have a plugin for both calendar and tasks functions. Maybe these could be used?
What you need to do for the Android apps to update the ownCloud calendar is to use some CalDAV client. I used OpenSync which sets up both CalDAV and CardDAV to an ownCloud source. Now you only need to find a calendaring app that can use CalDAV streams. Fortunately a lot of them do. I started using BusinessCalendar2 – and that works very nicely, except for one factor in the premise. Point you Android app to the calendar stream (you get the address from the ownCloud calendar page) and CalDAV does the rest. Updating the calendar from ownCloud or from the laptop or from the phone pushes the appointment to the other device. I was very happy with this, because I live on these devices most of the day. To get Kontact to recognize ownCloud calendars, however, you need to – yet again – go into akonadiconsole and add a DAV resource
which you point to the CalDAV and (optionally) CarddDAV streams. This works nicely, and it adds the calendars it finds automatically. You then just enable the ownCloud calendars in the calendar module of Kontact.
Now, comes the tricky part. Getting the ownCloud calendars working on Windows! Remeber I used Outlook on Windows because, well, I thought it was a good one-in-all package that would solve all integration problems (I’m a sucker for integration, hence Kontact). So adding the owncloud calendars is simply a matter of pointing Outlook to the shared link for the calendars and import them, right? Wrong!
Outlook 2019 doesn’t handle authentiation like the rest of the world (surprise?) so, even if you can can to try add calendars that way, it doesn’t work. Outlook goes through the routine, and doesn’t report any errors, but you will not see your calendars. The recommended work-around is the to use Outlook OWA instead. And you can can to try add calendars that way, but they are not functional. At least when I did it. Outlook added the calendars, but then they did not contain any information, and they didn’t update either direction.
Rather than trying to fix Outlook, I threw it out and started using Thunderbird instead. And, lo and behold! It simply works. Pointing Thunderbird to ownCloud I am getting mail and calendars on my Windows desktop computer.
There probably is room for improvement here, as I really don’t like Thunderbird if I don’t have to use it (did I mention that it’s fugly?). So it’s possible I’ll have another go at getting Outlook to play nice with external calendars.
Tasks are tricky to get working on Android when you are using ownCloud as the backend – or to be honest, are using anything other than Google. I’ve found only one integrated Caledar/Tasks app that handles tasks correctly (or at all) on Android and that is CalenGoo. It’s not free unfortunately, but it is at least cheap. Ish. Point CalenGoo towards your ownCloud calendar(s) and you are ready to use both calendars and tasks from ownCloud.
As an after-thought I added contacts to the integration mix, as this is one feature I really miss from when I had everthing on Google. Fortunately it is very easy to add contacts and they synchronize off of the ownCloud backend without a hitch. Depending on where you have your contacts stored, you need to export them as a vcard-file and then import the resulting vcard-file into ownCloud. You will then have them synchronized across your devices, provided that the basic setup is working as it should (which it should by now).
So, there you have it! Mail, calendars, to-do’s, files and contacts synchronizing across three devices – a Windows desktop computer, a Linux laptop, and an Android phone with your own cloud solution as a back-end. It’s partly tricky – but once you get all the pieces to play nice, you’ll be happy with how it works.
I hope this write up will help someone, and give others some ideas on how to solve the challenge they are facing.