Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
No can do. Our organization is a public pension fund manager and nothing goes into any cloud -- policy.
Nevertheless, I assume Tbird/Lightning must work better with CalDEV than WebDAV calendars, hence the reason it would work with Owncloud or google calendar. I will probably experiment with TB and CalDEV, but setting up a self-hosted CalDEV server seems non-trivial compared with a WebDAV server, esp. with Apache (which is our current WebDAV server).
I guess I didn't read far enough about owncloud. Thanks for that tip and DaviCAL also! I'm going to first try getting Apache working with CalDEV (since it's the devil I know), but if that gives me no joy I'll check out these others.
I guess I didn't read far enough about owncloud. Thanks for that tip and DaviCAL also! I'm going to first try getting Apache working with CalDEV (since it's the devil I know), but if that gives me no joy I'll check out these others.
I might as well continue with my blow-by-blow update. The mod-caldev for Apache on Sourceforge appears to be for Apache 2.2.12 whereas the latest Apache source is 2.4.18. Since the mod-dav-acl is a souce patch to mod_dav, I'm very skeptical the 2.2.12 patches will work on 2.4.18.
So, moving on ... my next attempt will be to try DaviCAL per one of descendant_command's recommendations. This currently appears to work with Apache: http://wiki.davical.org/index.php/Apache_Config.
Final (maybe) update. In the end, I decided not to go with CalDAV and try to get WebDAV working. The problem is that we will have a mixed Outlook / Thunderbird-Lightning workstation environment. I'm concerned that after all the effort to get a CalDEV or DaviCAL server going, Outlook won't work since Outlook is said to only work with WebDAV. On the other hand, Lightning does not update the server .ics file when changes are made to the Calendar if using WebDAV, so, catch 22, I can't use a CalDAV server with Outlook and I can't use a WebDAV server with Lightning ...
or can I?
In fact, my solution didn't take that long. Since my WebDAV server is self-hosted on the AD/DC, and since the Calendar databases for all users also resides in their Thunderbird profile location on the AC/DC, I have physical access to the calendar source and the ics destination. So, I looked at the published output of the .ics file and perused the local.sqlite database and came up with a script which I can run from root's cron that checks for updates in the sqlite calendar database and creates a new .ics file. The new timestamp on the ics file causes both Outlook and Lightning subscribers to refresh the workstation calendars! Now I basically have WebDAV working for Lightning.
(btw I consider Lightning's inability to update published WebDAV calendars when the calendar owner makes a change to be a bug. This provides no difference between WebDAV publishing and simple exporting.)
Below is the core code without all the extra scanning of everyone's ics files, checking for changes and copy new files.
I'm going to bookmark this thread because when everyone is moved off Outlook, I can follow-through with the DaviCAL server and finally let calendar subscribers update subscribed calendars like they used to do with Exchange.
Feedback welcome
Code:
# calendar database is e.g. /redirectedFolders/Users/mark/.thunderbird/28ngbwvw.default/calendar-data/local.sqlite
if [ -z "$1" ]
then
echo syntax: `basename $0` databaseFile
exit
fi
DATABASE="$1"
# Time formats and timezone info. I know I'm -5 hours GMT, so I'm just hard-coding that
FMT="Y%m%dT%H%M%SZ"
FMT2="%Y%m%dT%H%M%S"
TZADJ=18000
# The original published .ics file seems to not have lines longer than 70 character.
# This function chop lines into 70 characters or less. The tilde (~) character is
# assumed to be a newline substitute and is replaced by a litteral "\n" after splitting.
function emit70
{
t=`echo "$1"`
while [ ${#t} -gt 0 ]
do
if [ ${#1} -ne ${#t} ]; then echo -n " "; fi
echo "$t" | cut -c1-70 | sed 's/~/\\n/g'
t=`echo "$t" | cut -c71-`
done
}
# The following "boilderplate" is copied directly from the originally published .ics file.
cat <<EOF
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:America/New_York
BEGIN:DAYLIGHT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
DTSTART:19700308T020000
RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
TZNAME:EST
DTSTART:19701101T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11
END:STANDARD
END:VTIMEZONE
EOF
# GET EVENTS
# Note that this query does not take into account the possibility of multiple
# calendars stored in the local.sqlite database. Possibly need to first
# 'select distinct cal_id' then loop through those. A "todo" for the future.
sqlite3 "$DATABASE" \
"select cal_id, id, time_created, last_modified, title, priority, privacy, event_start, event_end,
event_stamp, event_start_tz, event_end_tz
from cal_events" | \
while read event
do
x=`echo $event`
if [ -z "$x" ]; then continue; fi
# icalString is multi-line. Get separately to make parsing easier
cal_id=`echo "$event" | cut "-d|" -f1`
id=`echo "$event" | cut "-d|" -f2`
icalString=`sqlite3 "$DATABASE" \
"select icalString from cal_alarms where cal_id = '$cal_id' and item_id = '$id';"`
time_created=`echo $event | cut "-d|" -f3 | cut -c1-10`
time_created=$[ $time_created + $TZADJ ]
time_created=`date -d@$time_created +$FMT`
last_modified=`echo "$event" | cut "-d|" -f4 | cut -c1-10`
last_modified=$[ $last_modified + $TZADJ ]
last_modified=`date -d@$last_modified +$FMT`
title=`echo "$event" | cut "-d|" -f5`
priority=`echo "$event" | cut "-d|" -f6`
privacy=`echo "$event" | cut "-d|" -f7`
event_start=`echo "$event" | cut "-d|" -f8 | cut -c1-10`
event_start=`date -d@$event_start +$FMT2`
event_end=`echo "$event" | cut "-d|" -f9 | cut -c1-10`
event_end=`date -d@$event_end +$FMT2`
event_stamp=`echo "$event" | cut "-d|" -f10 | cut -c1-10`
event_stamp=$[ $event_stamp + $TZADJ ]
event_stamp=`date -d@$event_stamp +$FMT`
event_start_tz=`echo "$event" | cut "-d|" -f11`
event_end_tz=`echo "$event" | cut "-d|" -f12`
cat << EOF
BEGIN:VEVENT
CREATED:$time_created
LAST_MODIFIED:$last_modified
DTSTAMP:$event_stamp
EOF
# Split up UIDs longer than 70 characters (could have used emit70() function)
echo UID:`echo $id | cut -c1-70`
if [ ${#id} -gt 70 ]; then echo " "`echo $id | cut -c71-`; fi
echo "SUMMARY:$title"
if [ -n "$priority" ]; then echo "PRIORITY:$priority"; fi
echo "DTSTART;TZID=$event_start_tz:$event_start"
echo "DTEND;TZID=$event_end_tz:$event_end"
# Get additional calendar properties (LOCATION, PRIVACY, etc.)
# Some have multi-line entries such as X-ALT-DESC. Substitute
# tilde (~) for newline (char(10)) to get everything on one
# line. emit70() will put litteral "\n" (not newline) back in.
sqlite3 "$DATABASE" "select key, value from cal_properties where cal_id = '$cal_id' and item_id = '$id';" | \
while read xtra
do
k=`echo $xtra | cut "-d|" -f1`
v=`echo $xtra | cut "-d|" -f2-`
x=`echo $v`
if [ -n "$x" ]; then emit70 "$k:$v"; fi
done
x=`echo $icalString`
if [ -n "$x" ]; then echo "$icalString"; fi
echo END:VEVENT
done
echo END:VCALENDAR
exit
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.