Mail Zip and print

Hello guys, i’m Francesco from Italy…
In Italy we use the PEC that is a kind of mail certificated.
When i send a PEC…returned two o more mail linked by the same identified messagge…
The name of this identified messagge is…“message ID”
The message ID is located in the body of the Mail…
It’ possible to create a script that zip all the mail that have the same message ID?
It’ possible to create a script that allow me to print all the Mail with the same message ID and their attachments?
I home you can help me…

Nobody can help me?