I have contacts and calendars in FastMail that I would like to make available in Ubuntu Touch.
1 Answers
First off, you may be interested in simply installing the FastMail webapp that gives you access to your mail, contacts, and calendars. But if you'd like deeper integration with your device, read on.
Preliminaries
Alternative password
You probably want to create an alternative password for your FastMail account, because we will be storing the password on your device. If you ever lose your device, you can simply disable this alternative password.
Go to your Password & Security settings panel and add a new "App Password."
If you choose to do this, use your new app password instead of your main password throughout these instructions.
Terminal access
Unfortunately, there's no simple graphical way to sync with FastMail, like there is for Google. So you'll need to use the terminal.
Either enable remote access or install and use the Terminal app directly.
Connecting to FastMail
Run the following commands in the terminal, replacing EMAIL
and PASSWORD
with your FastMail email and password.
syncevolution --configure --keyring=no --template webdav username=EMAIL 'password=PASSWORD' target-config@fastmail
syncevolution --configure --template SyncEvolution_Client sync=none syncURL=local://@fastmail username= password= fastmail
Syncing your contacts
Note that if you have the "Auto-save contacts" FastMail feature enabled, you will end up with a lot of email-address-only contacts in your phone. There isn't a workaround for this currently, except to deal with it or disable "Auto-save contacts."
Again, replace EMAIL
with your FastMail email.
syncevolution --configure --template webdav database=https://carddav.fastmail.com/dav/addressbooks/user/EMAIL/Default backend=carddav target-config@fastmail fmcontacts
syncevolution --configure sync=two-way backend=contacts database=Personal fastmail fmcontacts
And perform an initial sync:
syncevolution --sync slow fastmail fmcontacts
Syncing your calendars
The simple way
If you don't use external calendars in FastMail, this simple way is good enough. And yup, replace EMAIL
with your FastMail email.
syncevolution --configure --template webdav database=https://caldav.fastmail.com/dav/calendars/user/EMAIL backend=caldav target-config@fastmail fmcalendar
syncevolution --configure sync=two-way backend=calendar database=Personal fastmail fmcalendar
And perform an initial sync:
syncevolution --sync slow fastmail fmcalendar
External calendars
If you do have external calendars, the above technique will flatten them all into one calendar in Ubuntu Touch, which isn't what you want.
So first we ask FastMail what calendars it has:
syncevolution --print-databases backend=caldav syncURL=https://caldav.fastmail.com/ target-config@fastmail calendar
Take the first URL (the one labeled "Calendar" and marked "<default>") and add it as your Personal calendar in Ubuntu Touch (replace URL
with that URL):
syncevolution --configure --template webdav database=URL backend=caldav target-config@fastmail fmcalendar-Personal
syncevolution --configure sync=two-way backend=calendar database=Personal fastmail fmcalendar-Personal
And perform an initial sync:
syncevolution --sync slow fastmail fmcalendar-Personal
Now for each of the other calendars you want to sync, you're going to create a new local calendar and connect it to the FastMail calendar. You'll use a new NAME
for each.
syncevolution --create-database backend=calendar database=NAME
syncevolution --configure --template webdav database=URL backend=caldav target-config@fastmail fmcalendar-NAME
syncevolution --configure sync=two-way backend=calendar database=NAME fastmail fmcalendar-NAME
And perform an initial sync:
syncevolution --sync slow fastmail fmcalendar-NAME
Staying in sync
To automatically keep your contacts and calendars in sync, you can tell Ubuntu Touch to sync once a day (at midnight). We're going to add a "cron job" which is a task that runs at a specified time. In our case, daily.
crontab -e
If it asks you which editor to use, pick vim.tiny (number 2).
Now you'll be looking at a text file with a bunch of comments. This is going to get specific. Follow the next instructions exactly.
Press i to start editing the file.
Type (or copy & paste)
@daily /usr/bin/env DISPLAY=:0.0 DBUS_SESSION_BUS_ADDRESS=$(ps -u phablet e | grep -Eo 'dbus-daemon.*address=unix:abstract=/tmp/dbus-[A-Za-z0-9]{10}' | tail -c35) /usr/bin/syncevolution fastmail > /home/phablet/fastmail-sync.log
Press Enter, Escape, :, x, and then Enter again
Removing your changes later
If you no longer want to keep your device in sync with FastMail, you can remove all sync configuration:
syncevolution --remove target-config@fastmail
syncevolution --remove fastmail
And remove all cron jobs:
crontab -r

- 3,675