Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a site (let's say that is being served from its own Virtual Server. The site is written in php.

Mail for this site is handled by a separate server. Everything is working correctly here for 'normal' mail (in other words MX and the such like appears to be ok and the mail server seems to be working correctly).

There are a number of places where email is sent from the website to the site administrators and a few of these are done via cron jobs on the server. One typical example is a housekeeping script that runs daily just to check there are no broken records in certain parts of the db and sends admins an email to confirm that everything is ok.

When it sends mail to a different domain (eg my copy goes to everything is fine. However when it sends to a user at, the web server tries to process the email internally. If the email is already set up locally (eg it is stored in the associated users mailbox. If it doesn't then the mail sending fails, even if the email address is correct based on the addresses configured on the mail server. Both of these behaviours are incorrect - we need it to relay the mail on to the mail server regardless.

What is slightly odd is that mail sent from the site via contact forms and so-on appears to be working correctly, even tho in both cases they are just using the php mail() function to send the mail.

Can anyone give me any pointers as to how to go about changing things so that mail for is handled by the mail server rather than the web server.

share|improve this question

Depending on how email is setup on that system, you might be able to setup .forward files (per account/user) to reroute things to where they belong.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.