I guess you could do that with a sieve rule, but I’m not a sieve expert. Here’s what you can do from the CLI:
Retrieve all mailboxes with a ‘Sent’ folder and delete mails older than 5 minutes:
for mailbox in $(docker-compose exec dovecot-mailcow doveadm mailbox list -A | grep Sent | awk '{print $1}')
do
docker-compose exec dovecot-mailcow doveadm expunge -u "$mailbox" mailbox 'Sent' savedbefore 5m
done