Skip to content

Commit

Permalink
Some servers only accept UTC timestamps. Refs #1323
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Cederstrand committed Oct 4, 2024
1 parent c1fba89 commit b4ce187
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions exchangelib/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def clean(self, version=None):
raise ValueError("'start' must be before 'end'")
if self.end < datetime.datetime.now(tz=UTC):
raise ValueError("'end' must be in the future")
# Some servers only like UTC timestamps
self.start = self.start.astimezone(UTC)
self.end = self.end.astimezone(UTC)
if self.state != self.DISABLED and (not self.internal_reply or not self.external_reply):
raise ValueError(f"'internal_reply' and 'external_reply' must be set when state is not {self.DISABLED!r}")

Expand Down

0 comments on commit b4ce187

Please sign in to comment.