mailcow / mailcow-dockerized

mailcow: dockerized - 🐮 + 🐋 = 💕
https://mailcow.email
GNU General Public License v3.0
8.95k stars 1.17k forks source link

Sogo config missing timezone info (and causing bugs) #677

Closed jesse-osiecki-zz closed 6 years ago

jesse-osiecki-zz commented 7 years ago

This is a strange one, but I was noticing that davcal and exchange events would not sync entirely with my Mobile device (Android 7.1.2) when syncing to the SoGo container in mailcow with caldav. I experienced similar bugs in exchange, but I will not go into detail about that here.

When I did a sync, some events would show up, some would not. Creating events in the webui and on Desktop (Evolution) would not create an event viewable on mobile, however the reverse did work.

I was getting the following error when using DavDroid to sync events

10-23 11:15:59.219  5581 26978 E davdroid: [syncadapter.CalendarSyncManager] Received invalid iCalendar, ignoring      
10-23 11:15:59.219  5581 26978 E davdroid: EXCEPTION at.bitfire.ical4android.InvalidCalendarException: Couldn't parse iCalendar resource                                                                                                       
10-23 11:15:59.219  5581 26978 E davdroid:      at at.bitfire.ical4android.Event$Companion.fromReader(Event.kt:84)     
10-23 11:15:59.219  5581 26978 E davdroid:      at at.bitfire.ical4android.Event$Companion.fromReader$default(Event.kt:76)                                                                                                                     
10-23 11:15:59.219  5581 26978 E davdroid:      at at.bitfire.davdroid.syncadapter.CalendarSyncManager.processVEvent(CalendarSyncManager.kt:179)                                                                                               
10-23 11:15:59.219  5581 26978 E davdroid:      at at.bitfire.davdroid.syncadapter.CalendarSyncManager.downloadRemote(CalendarSyncManager.kt:143)                                                                                              
10-23 11:15:59.219  5581 26978 E davdroid:      at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.kt:155)                                                                                                                 
10-23 11:15:59.219  5581 26978 E davdroid:      at at.bitfire.davdroid.syncadapter.CalendarsSyncAdapterService$SyncAdapter.sync(CalendarsSyncAdapterService.kt:55)                                                                             
10-23 11:15:59.219  5581 26978 E davdroid:      at at.bitfire.davdroid.syncadapter.SyncAdapterService$SyncAdapter.onPerformSync(SyncAdapterService.kt:57)                                                                                      
10-23 11:15:59.219  5581 26978 E davdroid:      at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)                                                                                            
10-23 11:15:59.219  5581 26978 E davdroid: Caused by: net.fortuna.ical4j.data.ParserException: Error at line 13:Expected [-3], read [58]                                                                                                       
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl.assertToken(CalendarParserImpl.java:462)                                                                                                         
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl.access$700(CalendarParserImpl.java:56)                                                                                                           
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl$ParameterParser.parse(CalendarParserImpl.java:328)                                                                                               
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl$ParameterParser.access$1800(CalendarParserImpl.java:322)                                                                                         
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl$ParameterListParser.parse(CalendarParserImpl.java:310)                                                                                           
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl$PropertyParser.parse(CalendarParserImpl.java:247)                                                                                                
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl$PropertyParser.access$1100(CalendarParserImpl.java:229)                                                                                          
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:210)                                                                                            
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.parse(CalendarParserImpl.java:422)                                                                                               
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.access$900(CalendarParserImpl.java:406)                                                                                          
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:208)                                                                                            
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendar(CalendarParserImpl.java:115)                                                                                                       
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendarList(CalendarParserImpl.java:180)                                                                                                   
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarParserImpl.parse(CalendarParserImpl.java:149)                                                                                                               
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:198)                                                                                                                     
10-23 11:15:59.219  5581 26978 E davdroid:      at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:178)                                                                                                                     
10-23 11:15:59.219  5581 26978 E davdroid:      at at.bitfire.ical4android.Event$Companion.fromReader(Event.kt:82)     
10-23 11:15:59.219  5581 26978 E davdroid:      ... 7 more 

Googling around I stumbled on https://sogo.nu/bugs/print_bug_page.php?bug_id=3995 which suggested my calendar events might not have a timezone. Sure enough the timezone is not set in sogo.conf in the mailcow-dockerized distribution. On further inspection, events that appeared in Android have a timezone set, those that had no timezone broke the calendar with the previous error.

I added a timezone in my sogo.conf and am trying to get the webui to add a timezone to my events.

relevant links: https://sogo.nu/bugs/print_bug_page.php?bug_id=3995 https://github.com/inverse-inc/sogo/commit/5300d4185d891145d7ad907a7f69cd011f4cf9b0

jesse-osiecki-zz commented 7 years ago

upon adding a timezone to my Account in the Sogo webui settings, the calendar does in fact add it to the raw event. The difference:

BEGIN:VCALENDAR
PRODID:-//Inverse inc./SOGo 3.2.10//EN
VERSION:2.0
BEGIN:VEVENT
UID:2F-59EE0C80-1-1014BBC0
SUMMARY:Send Check
CLASS:PUBLIC
BEGIN:VALARM
TRIGGER;RELATED=START;VALUE=DURATION:-PT5M
ACTION:DISPLAY
END:VALARM
TRANSP:OPAQUE
DTSTART;:20171023T170000Z
DTEND;:20171023T180000Z
CREATED:20171023T153734Z
DTSTAMP:20171023T153734Z
LAST-MODIFIED:20171023T153734Z
END:VEVENT
END:VCALENDAR

to

BEGIN:VCALENDAR
PRODID:-//Inverse inc./SOGo 3.2.10//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:America/New_York
X-LIC-LOCATION:America/New_York
BEGIN:DAYLIGHT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
DTSTART:19700308T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
TZNAME:EST
DTSTART:19701101T020000
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:30-59EE0E00-7-2BDE1940
SUMMARY:test
CLASS:PUBLIC
BEGIN:VALARM
TRIGGER;RELATED=START;VALUE=DURATION:-PT10M
ACTION:DISPLAY
END:VALARM
TRANSP:OPAQUE
DTSTART;TZID=America/New_York:20171023T034500
DTEND;TZID=America/New_York:20171023T044500
CREATED:20171023T154218Z
DTSTAMP:20171023T154218Z
LAST-MODIFIED:20171023T154218Z
END:VEVENT
END:VCALENDAR
stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.