I have some experience using experience using postfix. We have a developer on the team that has more experience than I do that would be able to help. I thought about trying to parse the emails to XML but, I am not sure that would work.
Not sure what you mean about parsing to XML, that wouldn’t help (they’d just have to be encoded as standard MIME afterward).
The general sequence is: