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 firstname.lastname@example.org. When an invalid email address is given on the form these bounces are going back to email@example.com.
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');