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 am sending email using mail() under PHP5 on Dreamhost (which I believe uses the local sendmail or other MTA) ... bounces are coming back to the sending shell user, instead of to the user in the From:/Reply-To: header. Any ideas?

share|improve this question
up vote 0 down vote accepted

You need to include the additional_parameters in the mail() call. If sendmail is being used then specify that as $additional_parameters = "-fwhateveryou@used_in.theheaders"

$additional_parameters = ""

mail($send_to, $message_subject, $mailBody, $mailHeaders,$additional_parameters);

That works for me to get the bounces back to the right place

share|improve this answer

Catch all

If mail is sent to a non-existing user on a domain it may be sent to the MTA's admin account.

This used to happen on my php contact form when spammers attempted to email an account on my domain that did not exist. The message would be passed to the admin MTA account instead of routed to the non-existent user.

share|improve this answer

I'm not sure if this is the case on sendmail, but in Exim, you needed to authorise the shell user to become a trusted user to allow it to send the correct From: header.

If you don't have access to change sendmail configuration, and you're sure you're sending the correctly-formatted From: header in your mail() call, you will need to contact Dreamhost's support.

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.