[BlueOnyx:25012] Re: Vacation message timezone

Andreas Ebertus lists.aeb at cbxnet.de
Wed Jul 21 07:46:42 -05 2021


Hi Michael,

wow, many thanks for the detailed explanation.
Although, I still think the problem is in ServerScriptHelper.php.
But let's start with some checks of the system:

> On your BlueOnyx go to https://<GUI>:81/time/timeconfig and see what
> time zone you have configured. I presume it's "Europe/Berlin".

Correct, it's set to "(GMT +2:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"

> Make sure to check if that coincides with what is actually configured on
> the OS level:

# ls -la /etc/localtime
lrwxrwxrwx 1 root root 38 24. Jun 09:32 /etc/localtime -> ../usr/share/zoneinfo/Europe/Amsterdam

It's Amsterdam, not Berlin, but should be fine.

> Additionally: Make sure that /etc/admserv/php.ini (the php.ini that is
> used for the GUI's AdmServ) also has the desired time zone set:

# cat /etc/admserv/php.ini |grep date.timezone
date.timezone = 'Europe/Amsterdam'

So the systems timezone settings look ok to me.

Why I think the problem is in ServerScriptHelper.php is this (my comments at the end of the lines):

// initialize timezone
$retvalTZ = @date_default_timezone_get(); //returns 'Europe/Amsterdam'
if (!$retvalTZ) {
    $timeObj = $cceClient->getObject("System", array(), "Time"); // not getting here
}
if (!isset($timeObj["timeZone"])) {  //thus, $timeObj is empty/undefined
    $timeObj["timeZone"] = "America/New_York"; //we're getting here
}
$systemTimeZone = $timeObj["timeZone"];
@date_default_timezone_set($systemTimeZone); // PHP's timezone gets overwritten with "America/New_York"

> As you can seem the keys 'vacationMsgStart' and 'vacationMsgStop' have
> the date and time as Unix time stamps.

And that leads to wrong time stamps being set. If I set the start date to 2021-07-21 8 am and stop date to 2021-07-21 6 pm I get this:
# /usr/sausalito/bin/cceclient
get 6.Email
102 DATA aliases = ""
102 DATA forwardEnable = "0"
102 DATA NAMESPACE = "Email"
102 DATA vacationMsg = "I'm out of office. Blah ..."
102 DATA CLASSVER = "1.1"
102 DATA forwardSave = "0"
102 DATA forwardEmail = ""
102 DATA do_not_reply_from = ""
102 DATA vacationMsgStart = "1626868800"
102 DATA do_not_reply = ""
102 DATA vacationMsgStop = "1626904800"
102 DATA vacationOn = "1"
201 OK

vacationMsgStart is this:
# date -d at 1626868800
Wed Jul 21 14:00:00 CEST 2021

Which is 8 am in New York:
# TZ='America/New_York' date -d at 1626868800
Wed Jul 21 08:00:00 EDT 2021

Same goes for vacationMsgStop.

If I implement my "fix" the time stamps are set with the correct timezone.

Let me know if I missed anything or if you need more information.


All the best,
Andreas




More information about the Blueonyx mailing list