mguessan / davmail

DavMail POP/IMAP/SMTP/Caldav/Carddav/LDAP Exchange and Office 365 Gateway - Synced with main subversion repository at
http://davmail.sourceforge.net
GNU General Public License v2.0
576 stars 85 forks source link

Events automatically change timezone and are consequently displayed with the wrong time #342

Closed logological closed 6 months ago

logological commented 6 months ago

I'm using DavMail 6.2.1 with Thunderbird 115 on openSUSE Tumbleweed. My system's timezone is set to America/Winnipeg (which is Central Time), and Thunderbird is configured to use this system timezone. The remote calendar on outlook.office.com is configured to use "Central Time (US & Canada)".

When I use Thunderbird to create a new event on the DavMail calendar, Thunderbird prompts me for the start and end times and indicates that the timezone is America/Winnipeg. After I press the "Save & Close" button, the event shows up in my calendar but with the start and end times one hour later than I had specified. If I open the event, I see that the timezone has changed from "America/Winnipeg" to "America/Chicago". I'm not sure whether it's DavMail or the remote calendar server that changed the timezone, but regardless, the displayed time shouldn't change because America/Winnipeg and America/Chicago are both on Central Time!

The problem happens only with the DavMail calendar.

Is this perhaps related to the timezone issue in Issue #337?

logological commented 6 months ago

I tried applying the fix from Issue #337 but this doesn't solve the issue for me.

esabol commented 6 months ago

I tried applying the fix from Issue #337 but this doesn't solve the issue for me.

There might be other related commits. Did you try compiling the latest master branch of the repo?

logological commented 6 months ago

Yes, I'm using the latest master branch.

logological commented 6 months ago

As a workaround, I've reconfigured Thunderbird's calendar to use America/Chicago as the timezone instead of America/Winnipeg. Now all events I create use America/Chicago by default and the times are shown correctly when the event is saved. I suppose this workaround is fairly safe for the foreseeable future, since there are no firm plans in either jurisdiction to change its timekeeping practices.

esabol commented 6 months ago

@logological wrote:

Yes, I'm using the latest master branch.

OK, that's good to know. Could you set DavMail to create a WIRE debug log and then reproduce the issue? That log file might help narrow down the problem for @mguessan .

The method is described here:

https://davmail.sourceforge.net/faq.html#Feedback

If you prefer to edit your properties file yourself, put the following lines in your properties file:

log4j.logger.httpclient.wire=DEBUG
log4j.logger.org.apache.http.wire=DEBUG

Quit and restart the DavMail application. Then reproduce the issue. DavMail will then create a detailed log of what it is doing. This log will be stored in a davmail.log file. By default, it will be located in DavMail's current working directory on Linux and Windows or in ~/Library/Logs/DavMail/davmail.log on macOS. (The location of this file can be customized with the Log File Path setting.) This log file might include information like your password or session token and other account details that you should not share online. If you are confident you can remove those things from the davmail.log file, feel free to post the sanitized file here. Otherwise, send the log file to mguessan@free.fr along with the URL of this GitHub issue. I hope this helps!

logological commented 6 months ago

I don't see how sending unsanitized logs by e-mail is much more secure than posting them here. Can you or @mguessan provide further details on how to remove sensitive information from the logs, or at least provide a PGP key so that I can send the logs via encrypted mail?

esabol commented 6 months ago

No, I cannot, as I've never had to do it myself, but I imagine it might be obvious if you examine the log file? The only part of the log file that would be of interest here is the part where it's doing the calendar interaction (look for CalDAV or similar) and clearly not the authentication part, where things would need to be sanitized.

mguessan commented 6 months ago

It seeems you made quite some progress with troubleshooting, basically America/Winnipeg is not working and America/Chicago is.

In the old days we used to rely on actual timezone information inside caldav events, however with latest Exchange/O365 versions only TZID is taken into account. Mapping table is at: https://github.com/mguessan/davmail/blob/master/src/java/exchtimezones.properties

Can you please confirm that America/Winnipeg maps to Central Standard Time?

logological commented 6 months ago

Can you please confirm that America/Winnipeg maps to Central Standard Time?

Yes, Winnipeg should be Central Standard Time. I'll test the trunk version with the new commit next week.

logological commented 6 months ago

I noticed that davmail 6.2.2 was released a couple days ago, which includes commit 130503ab263cd5cb7ec66b8c4d3bb9b5898205ce. I've tested this version and have confirmed that there is no longer any problem creating events with the timezone set to America/Winnipeg. Thanks!