Welcome to WebmasterWorld Guest from 126.96.36.199
I have a WAMP server for a domain that I am managing that I want to do email piping on but since all email received will be piped to the same php script I am wondering if this can be done simply using Apache.
Can I set up a subdomain in apache sub.domain.com that listens to the incoming mail port and have the script as index.php?
Receiving email is only possible using an SMTP server (which is communicating with the smtp protocol), and as such, it only can be found in mail servers like postfix or exchange. If you want a server-side script or executable receive emails, you have two options (i can think about in this second).
Implement a pop3 email client in your code, make it connect to the email server periodically, and read the mails from the remote server's mailbox. This requires that your executable or script is periodically called or executed by crontab or scheduled tasks.
Some mail servers support executable accounts (such an account which does not actually have a mailbox, you can not connect to this account by email clients, but each time a mail arrives to this mailbox, a program is executed by the mail server). This is much better for your problem, but if you are using a mail server which does not support such an account (the name of this type of account is certainly different for each mail server), then this option is not for you.