Hi,
This script may help you:
https://github.com/vdukhovni/postfix/tree/master/postfix/auxiliary/collate
Maybe there are other scripts on sources that can help you.
But most of times you need to write a solution that fits your needs.
Regards.
 so I wanted to pu