When setting up my email and calendar I stumbled upon two interesting facts:
- When using Apple Calendar as CalDAV client email invitations are not sent at all
- When using the web-based calendar from Synology the organizer of the event would be „user@local.host“
I imagined these were known issues for which there is a fix or workaround. Unfortunately neither seems to be the case. And to make things worse the situations seems to be like that for years. There are forum posts looking for solutions in the official Synology community as well as in the German-language Synology Forum. It seems many even have contacted the Synology support and got unsatisfying responses or the promise that the development team would certainly take care – which they didn’t do up to now.
So I spent some time (way too much time) trying to find a solution to this topic – workarounds like setting up users with the Directory Service instead of local account failed because suddenly I had authentication issues with SMB which I didn’t want to deal with. I also didn’t want to set up nextcloud or another big package on my DiskStation. I have an ownCloud instance for a long time, which is using a different domain and runs on another server, so nothing like that is needed.
So ultimately I decided to look for a fix myself, SSHd into my DiskStation and investigated what’s going on with Calendar. So here are my findings:
- Synology uses the DAViCal open source calendar, which is based on PHP 5 and Postgres
- They add their own JS-based web-client
I was only able to resolve the „user@local.host“ issue so far, so here’s what I did:
Make sure you can access the DiskStation via SSH
Change to super user mode with
sudo su
Connect to the Postgres database:
psql -U postgres calendar
Have a look at your user list
select * from usr;
The following command updates the email for one single user. You could also run a more elaborate query using sql REPLACE() function if you have many local users. But I assume you have local users and no directory because you only have a few users. Please replace yourdomain.tld with your own domain and the word user with whatever your username / email name is
UPDATE usr SET email='user@yourdomain.tld' WHERE email='user@local.host'
;
Leave the Postgres console with exit
(Enter)
Now you need to be familiar with vi or install the nano editor which is part of the SynoCli File Tools package. If you aren’t familiar with either – good luck.
We need to edit the following two files – example with nano – if you know how to handle vi you won’t need my instructions anyway.
nano /volume1/@appstore/Calendar/nodejs/jslib/evt_adapter/index.js
Use CTRL+W to search for „local.host“ – replace local.host with your domain. Then save the file with CTRL+X and confirm with Y
nano /volume1/@appstore/Calendar/ui/synocalendar-common_utils.js
Same story – use CTRL+W to search for „local.host“ – replace local.host with your domain. Then save the file with CTRL+X and confirm with Y
Now I thought I would be done but still the invitations from the calendar would show local.host – the problem is that the event is created by the JS-frontend which is cached in your browser. In my case restart fo the DiskStation and signing in again didn’t resolve the issue. So you have to either clear your browser cache or delete the site’s app cache. The latter works like this in Chrome:
- Open Synology’s web-based calendar
- Since the right-click menu is disabled in the web-calendar go to View -> Developer -> Developer Tools
- Switch to the Application Tab in Developer tools
- Click „Clear site data“
Now you should be able to send invitations which show your custom domain for the organizer. Hurray!
7 Gedanken zu “Fix: Synology Calendar sends invitations as „user@local.host“”
Thanks a lot for this page.
Is there any explanation why, after modification, I can’t see any update in the result of the „select * from usr;“ commad ? I don’t see local.host replaced by mydomain.tld.
Did you run the UPDATE query with ; at the end? I’ll update it on the page now.
on my diskstation the files are on volume2. So before editing your .js files make sure the path is correct.
Really glad that I found your post regaridng the current issues while using synology calendar. However I could not access the postgres databse and dont know why. Nothing really opend up after entering the command you highlighted above (psql -U postgres calendar). I’m pretty sure that I did something wrong but maybe you can elaborate a little bit more about this step. Thank you!
When entering postgres not much is actually happening but the command prompt should change from
user@diskstation.local:~$
(Before
sudo su
command)ash-4.4#
(After
sudo su
command)to
calendar=#
(This means you’re in psql console)
Is this different in your case?
Good Job!
The problem „Apple Calendar as CalDAV client email invitations are not sent at all“ but remains!?
Thank you so much! It’s sad that Synology has failed to correct this for so long. I updated your instructions to use the VIM editor built in to the Synology and have shared them here: https://matt.armbruster.org/projects/fix-synology-calendar-sends-invitations-as-userlocal-host/