Skip to content

fix(gmail): use configured timezone for Date header (#472)#514

Closed
dinakars777 wants to merge 1 commit intoopenclaw:mainfrom
dinakars777:fix-gmail-send-timezone
Closed

fix(gmail): use configured timezone for Date header (#472)#514
dinakars777 wants to merge 1 commit intoopenclaw:mainfrom
dinakars777:fix-gmail-send-timezone

Conversation

@dinakars777
Copy link
Copy Markdown
Contributor

Fixes #472.

Instead of directly invoking time.Now().Format() using the system's runtime timezone, we now properly fetch the globally configured timezone through getConfiguredTimezone. This ensures the Date header correctly aligns with the application-wide explicit configuration and falls back to time.Local correctly if not set, avoiding the +0900 timezone delivery misconfiguration.

Fixes openclaw#472

Instead of directly invoking time.Now().Format() using the system timezone,
we now fetch the globally configured timezone through getConfiguredTimezone, ensuring
the Date header format properly aligns with explicit configuration and avoids the +0900 issue.
@dinakars777 dinakars777 force-pushed the fix-gmail-send-timezone branch from 21a541e to 05e427c Compare April 21, 2026 05:23
@steipete
Copy link
Copy Markdown
Collaborator

Landed manually on main in 2c48bd8, with lint cleanup in 6bdc215.

I kept the intended fix: outbound RFC822 Date headers now use the configured timezone (GOG_TIMEZONE / default_timezone) and fall back to local time when none is configured.

I also added regression coverage in internal/cmd/gmail_mime_more_test.go for a host-local JST process with GOG_TIMEZONE=UTC, asserting the generated Date header uses +0000.

Verified locally:

  • go test ./internal/cmd -run 'TestBuildRFC822|TestGmailSend|TestGmailDraft' -count=1
  • make ci

Thanks @dinakars777.

@steipete steipete closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] gmail send --reply-to sets wrong timezone (+0900) in Date header causing delivery failure

2 participants