Re: [SOGo] Timezone bug

2021-07-15 Thread m...@netbsd.org
Emmanuel Dreyfus  wrote:

> Server side, default is Europe/Paris, and date indeed displays Paris time.

I made some progress! I copied /usr/share/zoneinfo/Europe/Paris from a Linux
system, restarted SOGo, and all events moved 2 hours forwards. The web
interface is now honouring the Europe/Paris setting.

The system is NetBSD. I compared the zoneinfo files, and indeed that are not
identical. I understand SOGo uses GNUstep for timezone information, and that
GNUstep does not use libc code to parse the file. The job is done in
gnustep-base/Source/NSTimeZone.m, I tried the patch below, but it did not fix
the problem. If someone knowledgable in objective C could help me tracking
down the bug it would be nice.

I can live with the zoneinfo file from Linux, NetBSD libc seems able to use
it. But if I either choose that workaround or find and fix the root cause for
the bug, I now face another problem: on a fixed system, I must fix the start
and end time for all events created by SOGo. 

That means iterating on all calendar in database and changing start and end
times for all events that match PRODID:-//Inverse inc./SOGo [0-9.]*//EN

Doing it in the _quick table is easy, but fixing the ICS data is more
complicated.


--- Source/NSTimeZone.m.orig
+++ Source/NSTimeZone.m
@@ -1584,17 +1584,18 @@
environment] objectForKey: @"TZ"];
}
 
 
-#if HAVE_TZSET && !defined(__FreeBSD__) && !defined(__OpenBSD__)
+#if HAVE_TZSET && !defined(__FreeBSD__) && \
+!defined(__OpenBSD__) && !defined(__NetBSD__)
   /*
* Try to get timezone from tzset and tzname/daylight.
* If daylight is non-zero, then tzname[0] is only the name
* the the zone for part of the year, so we can't use it as
* the definitive zone.
*
* FreeBSD doesn't implement TZSet fully, so we can't use it there.
-   * Apparently, OpenBSD neither.
+   * Apparently, OpenBSD and NetBSD neither.
*/
   if (localZoneString == nil)
{
   localZoneSource = @"function: 'tzset()/tzname'";



-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
m...@netbsd.org
-- 
users@sogo.nu
https://inverse.ca/sogo/lists


Re: [SOGo] Timezone bug

2021-07-13 Thread Emmanuel Dreyfus
On Tue, Jul 13, 2021 at 03:33:04PM +, "Nagel, Peter" wrote:
> what timezone is set on your server and what time does it show? If your
> server is set to UTC and the time isn't UTC you will get this offset...

Server side, default is Europe/Paris, and date indeed displays Paris time.

$ ls -l /etc/localtime 
lrwxr-xr-x  1 root  wheel  32 Oct 13  2011 /etc/localtime -> 
/usr/share/zoneinfo/Europe/Paris
$ echo $TZ

$ date
Tue Jul 13 18:44:47 CEST 2021

sogod has no TZ in its environment (shown by ps -e), and SOGoTimeZone
is set to Paris:
# su -l sogo -c 'defaults read sogod SOGoTimeZone'
sogod SOGoTimeZone Europe/Paris


-- 
Emmanuel Dreyfus
m...@netbsd.org
-- 
users@sogo.nu
https://inverse.ca/sogo/lists


Re: [SOGo] Timezone bug

2021-07-13 Thread m...@netbsd.org
Emmanuel Dreyfus  wrote:

> I have a timezone problem with invitations and Thunderbird

Erratum: not about invitations but events. But the same problem happens
with events generated from invitations.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
m...@netbsd.org
-- 
users@sogo.nu
https://inverse.ca/sogo/lists