Skip to content

Issue with IMAP SINCE ’Search‘ Timezone Handling #919

@Wanglintc

Description

@Wanglintc

Description:
I am using the node-imap package in my Node.js application, and my email server is hosted on Alibaba Cloud in China. My Node.js server is also located in China, operating in the China Standard Time (CST) timezone, which is UTC+8.

Here's my issue: when I perform an IMAP search using the SINCE condition with a date string like '2024-08-05', it seems like the IMAP server interprets this date as '2024-08-04 16:00:00' UTC due to the timezone difference. This results in missing emails that arrived between 2024-08-05 00:00:00 CST and 2024-08-05 08:00:00 CST.

Questions:

  1. How can I ensure that the SINCE condition in the IMAP search takes into account the local timezone (CST) and does not miss any emails?
  2. Is there a recommended approach to handle this timezone difference when performing IMAP searches with the SINCE condition?
  3. Are there any best practices for ensuring consistent time handling between the client and server when both are in different timezones?

Any help or guidance on this issue would be greatly appreciated. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions