This could be done in 2 ways. Create the report directly from the log file (probably slow and may not be 100% due to log-rotate) or make a script to parse the log (on daemon run?) and dump it into a database which can later be read by another script that will sort the data according to your needs. The difficult part is how to put the data descriptions in the database so they can be sorted. Unfortunately I do not have the time to work on something like this at this time.
I'll try and do a search also to see if anything is out there already.
After a quick search There seems to be a few things out there. Google: php script to parse postfix logs
I'll try and do a search also to see if anything is out there already.
After a quick search There seems to be a few things out there. Google: php script to parse postfix logs