Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Email Piping without an email server?

2:53 am on Dec 11, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 15, 2005
votes: 0

Sorry if this is a crazy question but I don't really know anything about email servers.

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?


2:26 pm on Dec 11, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:May 4, 2004
votes: 0

It is indeed crazy, as you already pointed out ;-)

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.