0

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?

singpolyma
  • 489
  • 2
  • 7
  • 19

3 Answers3

1

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.

RussellBallestrini
  • 191
  • 1
  • 1
  • 8
0

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.

Andy Shellam
  • 1,828
  • 1
  • 12
  • 16
0

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"
e.g.

$additional_parameters = "-fuser@example.com"

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

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