Retrieving email attachments from POP3 accounts with PHP?

OK, a bit afield from typical WP fare, but I need this functionality in a plug-in. I need to be able to open a POP3 mail account, read the email, filter out files sent as attachments and — if they’re zips unzip them — and then place the files on the local drive where they’re needed.

I’m cool with zip and unzip classes in PHP, but I’m not sure how to retrieve and parse attachments from POP3. Anyone tried this?