I am looking for imap or pop3 to receive only the most recent emails.
Virtual-plugin seems to meet my needs
https://doc.dovecot.org/configuration_manual/virtual_plugin/#virtual-plugin
List messages from past 48 hours (syntax is in seconds):
# ~/Maildir/virtual/recent/dovecot-virtual INBOX work/* all younger 172800
but this will create a virtual/*, I want to control the real INBOX.
The user can set the email for how long it takes to set itself, for example, within 3 months by default.This way you can use all the mail to display to the client.