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?
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 = "-firstname.lastname@example.org"
mail($send_to, $message_subject, $mailBody, $mailHeaders,$additional_parameters);
That works for me to get the bounces back to the right place
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.
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.