It wouldnt be too tough to write in php. I would search stack overflow for a slolution but essential this is what i would do.
I would create an actual email address with a catch all alias associated to it. Then in MySQL i would create the email addresses that i want to recieve mail to.
So i would have :
anon-23432434@mydomain.com
anon-44655654@mydomain.com
(you can name them whatever you want)
when someone sends email to any of these addresses, it would go to the catchall@mydomain.com email address and sit in the inbox.
Next create a php script that can use pop to read emails and delete them from the server. I think PHP has built in functions for this. The script would check the send to address and look it up in your database. Then i could forward it to the right recipeient (this is what craigslist does), or it could be more elaborate and put the message in your database for an internal messaging system (sorta like linkedin or facebook)
Not that tough to build at all.