The very first thing you need to find out is what you rmail server is. There are many, and each can be configured to handle mail accounts in a variety of ways.
We don't know what software you're using or how it's set up, so there's not a lot we can do to help.
Try telnetting to the mail port (websearch for "sample pop telnet session" for examples) - your webserver may be configured to identify itself to people who connect to it. Once you find this out, you need to search the web for documentation on this server to see where the config settings for your mail server are likley to be stored. When you find the config file you need to read it to see how it handles email accounts.
Then you might be able to start using PHP to manipulate the email accounts.