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

Since I separated my mailserver from the apache/webserver for the same domain, I worry about mails which are sent e.g. via php from the webserver to It's trying to deliver the message on localhost although the email server (target) is another machine :-(

How to fix the route to get the mails delivered?


share|improve this question
Possible duplicate:… – adamo Sep 28 '12 at 7:53
up vote 0 down vote accepted

You just need to make sure that Sendmail on the web server does not think is a local name, which should be as simple as removing it from the local-host-names file (I'd also remove any references from the virtusertable if it's in there).

If the web & mail server are on the same network I would also suggest configuring your web server to use your mail server as a smart host so that the web server forwards all mail to it and let the mail server handle all mail delivery. This is done with the DS option in but depending on your OS this file may be auto-generated from an mc file. On my systems I have a {hostname}.mc file in /etc/mail that contains a SMART_HOST option. This can then be used to generate a new by running make in the same directory.

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.