It seems that most cgi / php scripts that send email do not get bounces. So you never know if the email address was legitimate or not. This is especially problematic when sending automated newsletter emails or updates. Ideally, you want bad addresses to bounce back so you can remove them from your list. Here's what I found out after some research.
The short answer is that you need to add this to the email headers:
Return-Path: you@yourdomain.com
Here's a sample php script to test the concept (edit the $to, $from, and $bounce variables accordingly:
<?
$to = junkaddress@yourdomain.com;
$from = "you@yourdomain.com";
$bounce = you@yourdomain.com;
mail("$to","Test Email","This is a message.\n\nTo: $to\nFrom: $from\nBounce: $bounce\n","From: $from\r\nReturn-Path: $bounce\r\n");
?>
Ok, email sent! <br>
To: <?=$to;?><br>
From: <?=$from;?><br>
Bounce: <?=$bounce;?><br>