Sync messages from 30 days ago

Hi all, is there a way to sync only the messages from 30 days on a IMAP account?
In my case I have a huge account (not much the size be the number of email).
It would be good to be able to sync only a week or a month.

Thank you.

@sirio81:

No idea – you’ll have to inspect the IMAP RFCs –

I tried asking chatgpt and it gave a good summary:

The IMAP (Internet Message Access Protocol) itself does not provide a direct mechanism to sync messages more recent than a specific period of time. IMAP primarily focuses on providing access to email messages stored on a mail server and managing mailbox folders.

However, you can achieve the synchronization of messages more recent than a specific period of time by combining IMAP with other techniques and features:

Search Commands: Most email clients that support IMAP have search capabilities that allow you to search for messages based on criteria such as date, sender, subject, and keywords. You can use these search commands to find messages that are more recent than a specific date.

IMAP IDLE: IMAP IDLE is a feature that allows an email client to receive real-time updates when new messages arrive in the mailbox. While it doesn't specifically filter messages by date, it ensures you are immediately notified of new messages, which may be more recent than a specific date.

Server-Side Filtering: Some mail servers offer server-side filtering and rules. You can set up rules on the mail server to automatically categorize or move messages based on criteria like date. This way, you can have specific folders or labels for messages received within a certain period.

Third-Party Tools: Some email clients and third-party email management tools offer advanced filtering and sorting capabilities. These tools may allow you to automatically sync and organize messages based on date ranges.

Custom Scripts: For advanced users and developers, you can create custom scripts or programs that use the IMAP protocol to fetch messages and filter them based on your specific criteria, including date.

Keep in mind that the exact capabilities and features available may vary depending on the email client and server you are using. While IMAP itself does not provide a built-in mechanism to filter messages by date, you can use the above methods to achieve similar results when syncing messages more recent than a specific period of time.

I think only the first point is meaningful for a client.
I notice Thunderbird has such feature and imapsync offer the option --maxage.
It could be an interesting feature.

I may open an RFE.