Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 am not a server administrator, but know my way around *nix and shell

Right now my web server is set up to relay to an e-mail address that does not exists. How can I change it.

Thanks for any answers or help, and please forgive my bad english.

best Regards


share|improve this question
By the way my php.ini sendmail_path is /usr/sbin/sendmail -t -i And as you guess I can't send e-mail from a simple PHP script. I get no errors, but the mail never arrives. – Jon Sep 3 '09 at 20:10
Tell us more: what SMTP server is installed (if any), what does its configuration look like, etc. – Bill Weiss Sep 3 '09 at 20:18
How do I find out what SMTP server which is installed? – Jon Sep 3 '09 at 20:27
telnet localhost 25 if one of the following has output socklist | grep 25 or netstat -an | grep 25 – petre Sep 3 '09 at 20:37
netstat -an | grep 25 gives me this: tcp 0 0* LISTEN – Jon Sep 3 '09 at 20:47

You may want to check out:


That is typically one of the first places to check for email forwarding. If that doesn't help, try:

grep -r /etc

Perhaps that will show you which file you need to edit.

share|improve this answer
And if you do change /etc/aliases, most mail servers need you to run newaliases in order to register the changes. – Nate Sep 3 '09 at 20:27
aliases did not tell me much and I could not find the I guess the it is a common Red Hat with Apache, PHP and MySQL setup, and I guess I am using sendmail since the php.ini file indicates so :) – Jon Sep 3 '09 at 20:29

Do you mean that mail from the web application running on your server is going to a non-existent address? If so, the address will probably be configured either in the config files for the PHP/Apache application, or somewhere in the database used by it. Try issuing:

grep -r

in whichever directory the website files are in.

share|improve this answer
Yes, the mail from the web application(PHP using mail() ) is not received. I've tried to add the -r in the fifth mail() parameter and the mail works from some locatoins. – Jon Sep 4 '09 at 10:36

Your Answer


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