A server I manage hosts around 200 sites each owned by different webmasters. A number of these have form to mail style scripts. A small problem is that the mailserver appears to be receiving emails from these scripts as email@example.com. When an invalid email address is given on the form these bounces are going back to firstname.lastname@example.org.
I was asked to fix the scripts to ensure that the bounces go back to the $from field. Here is a quick fix.
Append -f $to to the mail() line… For example change
mail($to, $subject, $message, $headers);
mail($to, $subject, $message, $headers, '-f $bounceto');