I did already start doing something like this (so did Dempsey IIRC for his WhoSentIt script)... The problem is that it's really hard to get the file size data properly... If it's not done right it all stops working... It is particularly hard to test as well as you have to keep being sent files and doing this with Polygamy from one account to another may not work properly all the time.
I will start looking at this again... (I've had enough of working on my bot atm... it doesn't seem to want me to listen for protocol messages
)