Your fundamental problem is going to be that even if you wrote or found a mail server implemented in PHP, you're not going to be able to run it on your host.
- The web server executing your PHP scripts is listening on port 80 (and maybe 443), not 25, 587, or 465.
- The scripts will get terminated by the web server after running too long or using too much RAM.
- You're not going to be able to run the script as a service on the host.
- Even if you could, most will have resource monitors that kill long-running scripts.
- Even if that weren't an issue, root privileges are normally required to listen on low-numbered (< 1024) ports.
Edit: All of the above assume shared hosting. Of course, most of these constraints go away with a VPS. However, in that case you can install proper mail servers so it doesn't really matter anyway.
Beyond all that, there's no particular reason that nobody's bothered writing a mail server in PHP, it's just that it's not a particularly useful endeavor.
@Linker3000 has it right in @Ignacio's answer: Move to a host that gives you what you want.