Hello,
This could be any script that connects to the mailbox through IMAP or POP and parse the messages.
I don't know if something similar already exists, ready for use, but it could quite easily be coded in python using existing libs like:
edit: this might be of interrest:
Kind regards
Sébastien Riccio
System & Network Admin
https://swisscenter.com