Retrieve IMAP email based on date AND time?

痴心易碎 提交于 2019-12-19 19:51:22

问题


I'm trying to retrieve email using IMAP that's less than a certain number of hours old. I've looked over the specifications, and there is a SINCE method that accepts an RFC date. However, it ignores the time and timezone. Is there another method I can use to retrieve email based on date as well as time? Thanks


回答1:


RFC 5032 documents the WITHIN extension which introduces the search keyword YOUNGER, which is what you're looking for.

For example, to search for all emails less than 2 hours old:

a SEARCH YOUNGER 7200


来源:https://stackoverflow.com/questions/6540718/retrieve-imap-email-based-on-date-and-time

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!