postalsys / imapflow

IMAP Client library for EmailEngine Email API (https://emailengine.app)
https://imapflow.com
Other
367 stars 64 forks source link

Hi folks I am trying to fetch mails from a inbox but seems like it does not take time in the since key. I am providing the date string in UTC format. Here is below code. Please me out as I am reading duplicate mails. If there is anything wrong in the date format. Please let me know as well. #216

Closed PrateekC08 closed 2 months ago

PrateekC08 commented 2 months ago

await imapClient.mailboxOpen('INBOX'); const listOfMessages = await Promise.all( subjectArrayForMails[tenant].map(async (subject: string) => { return await imapClient.search({ since: new Date(data.data[0].time).toISOString(), subject: subject, from: senderMail, }); }) );

The below date is provided to since in this format 2024-09-05T04:09:40.000Z

andris9 commented 2 months ago

IMAP protocol supports only dates but not times or timezones so your query term is converted to 2024-09-05

PrateekC08 commented 2 months ago

Alright thanks a lot