Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Forwarding email aliases for users



4:55 pm on Oct 28, 2011 (gmt 0)

10+ Year Member

The background info is this... I have a site where users can sign up for their own website. As well as having a subdomain address for their site (e.g. johnsmith.example.com) they could have their own domain (e.g. theirdomain.com) pointed to their site via the use of a CNAME record.

As well as the website, I'd like to offer users the ability to have email addresses @theirdomain.com. It would be a simple forwarder that would forward any mail sent to an address @theirdomain.com to the email address that I have on file for them.

As such, I'm hoping to avoid having to create mailboxes for each user, I just want to offer forwarding, no storage. Also, as the signup process is completely automated, I'd like this forwarding to be done through a PHP script so that I don't have to mess about with changing server config files every time a new user signs up.

I'm familiar with piping emails to a PHP script, but I don't have a clue where to start with this problem! Any help greatly appreciated!


4:21 pm on Oct 29, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

piping emails to a PHP script

That is a good place to start. Where are you stuck at?


10:06 pm on Oct 29, 2011 (gmt 0)

10+ Year Member

I've got the email being piped to the script, but I'm not sure how to transparently forward the email onwards... I've only ever used the script to upload a file.

Also, do I need to add something to the server to enable it to accept mail for a domain? I'm guessing there'll need to be an MX record for the domain but is there anything else that needs to be in place?