How to manage replies directly in email notifications
There is no better way. Depending on what you want to do with the responses, you can also process them with thunderbirds post filters;).
Put a unique identifier in the subject or body of the sent notification so you can correctly identify and categorize the email when the user replies with the email.
If you want to stick with php: choose php pop3 client class from: http://www.phpclasses.org/browse/package/2.html or find client elsewhere and then just parse your post responses and categorize / process them but you want.
source to share
As an educational exercise, you can read the PHP code and documentation in the drupal module http://drupal.org/project/mailhandler of the mail handler. This accepts emails and looks for the script as instructions.
The answer above about validating the post id is also very important.
source to share