[horde] ActiveSync -> CalDAV Timezone problems

Steffen skhorde at smail.inf.fh-bonn-rhein-sieg.de
Thu Mar 17 08:42:03 UTC 2016


On Wed, 16 Mar 2016, Michael J Rubinsky wrote:
> Quoting Jan Schneider <jan at horde.org>:
>
>> Zitat von Jan Schneider <jan at horde.org>:
>> 
>>> Zitat von Steffen <skhorde at smail.inf.fh-bonn-rhein-sieg.de>:
>>> 
>>>> Hi,
>>>> 
>>>> with
>>>> Horde_ActiveSync             2.31.6  stable
>>>> kronolith                    4.2.15  stable
>>>> 
>>>> when I create an event with Android ActiveSync, I get an entry with 
>>>> event_timezone = 'CET' in the database; the GUI and ActiveSync display 
>>>> the event correctly. But when downloaded by CalDAV I get this:
>>>> 
>>>> BEGIN:VCALENDAR
>>>> VERSION:2.0
>>>> X-WR-CALNAME:Calendar of dvtest1
>>>> PRODID:-//The Horde Project//Horde iCalendar Library//EN
>>>> BEGIN:VEVENT
>>>> DTSTART;TZID=CET:20160308T150000
>>>> DTEND;TZID=CET:20160308T153000
>>>> DTSTAMP:20160314T123714Z
>>>> UID:20160314132443.4C_Xp8mUFWBF6GsNZi0nVRb at ...
>>>> CREATED:20160314T122443Z
>>>> LAST-MODIFIED:20160314T122443Z
>>>> SUMMARY:B15:00
>>>> CLASS:PUBLIC
>>>> STATUS:CONFIRMED
>>>> TRANSP:OPAQUE
>>>> BEGIN:VALARM
>>>> ACTION:DISPLAY
>>>> DESCRIPTION:B15:00
>>>> TRIGGER;VALUE=DURATION:-PT15M
>>>> END:VALARM
>>>> END:VEVENT
>>>> BEGIN:VTIMEZONE
>>>> TZID:CET
>>>> END:VTIMEZONE
>>>> END:VCALENDAR
>>>> 
>>>> My client is totally confused by the timezone CET. If I replace the 
>>>> string CET by "Europe/Berlin" in the database, I get the correct date in 
>>>> the CalDAV client, too, and a lot more entries in VTIMEZONE.
>>>> 
>>>> The user has Europe/Berlin as default timezone, as does PHP.
>>>> 
>>>> Is this some configuration error?
>>>> If I remember correctly, ActiveSync storred UTC as timezone, didn't it?
>>>> 
>>>> -- 
>>>> Steffen
>>> 
>>> Looks like starting with PHP 5.5.10 DateTimeZone no longer converts 
>>> timezone abbreviations to full timezone names, which is of course a big BC 
>>> break. We would have to work around this.
>> 
>> OTOH we don't import unknown timezones anyway, at least not via iCalendar 
>> import. But maybe we do this differently with ActiveSync. Michael does know 
>> better.
>
> Timezones from ActiveSync clients are presented in an MAPI encoded binary 
> format that describes the timezone instead of naming it. We use 
> DateTimeZone::listIdentifiers to retrieve the list of supported timezones 
> when parsing the MAPI data to determine the matching/supported timezone name. 
> So, if the timezone name comes from ActiveSync it means is MUST have been 
> returned by DateTimeZone.

Horde/Mapi/Timezone.php

     public function getTimezone($offsets, $expectedTimezone = null)
     {
         $timezones = $this->getListOfTimezones($offsets, $expectedTimezone);

ska_dumpvar('Mapi/getTimezone() = ', array("offsets" => $offsets, "expect" 
=> $expectedTimezone, "tz" => $timezones));

         if (isset($timezones[$expectedTimezone])) {
             return $expectedTimezone;
         } else {
             return current($timezones);
         }
     }


has:

Mapi/getTimezone() =
array(3) {
   ["offsets"]=>
   string(232) 
"xP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAFAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAEAAIAAAAAAAAAxP///w=="
   ["expect"]=>
   string(13) "Europe/Berlin"
   ["tz"]=>
   array(13) {
     ["Africa/Algiers"]=>
     string(3) "CET"
     ["Africa/Bangui"]=>
     string(3) "WAT"
     ["Africa/Brazzaville"]=>
     string(3) "WAT"
     ["Africa/Douala"]=>
     string(3) "WAT"
     ["Africa/Kinshasa"]=>
     string(3) "WAT"
     ["Africa/Lagos"]=>
     string(3) "WAT"
     ["Africa/Libreville"]=>
     string(3) "WAT"
     ["Africa/Luanda"]=>
     string(3) "WAT"
     ["Africa/Malabo"]=>
     string(3) "WAT"
     ["Africa/Ndjamena"]=>
     string(3) "WAT"
     ["Africa/Niamey"]=>
     string(3) "WAT"
     ["Africa/Porto-Novo"]=>
     string(3) "WAT"
     ["Africa/Tunis"]=>
     string(3) "CET"
   }
}

===

If "Europe/Berlin" would be part of the array, this function would return 
"Europe/Berlin"; because it is not, current() seems to return "CET".

-- 
Steffen


More information about the horde mailing list