Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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 bad_email@address.com /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 bad_email@address.com 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 nonexistent@address.com

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.