hi, I was fed up with getting a lot of bounce mails of users on my host, who apparently just have discovered the mail() function in PHP and are writing mails to bogus recipients.
Apparently, the default "Return-Path" that is being set by our MTA (qmail) is "Return-Path: <anonymous@myhost>", even if the user has set a "From:" header. I thought this was quite counter-intuitive, as any error messages, such as not available mailboxes etc.. were bouncing back to me instead of the users. Instead of documenting this behaviour and telling all users that they should also add a "Return-Path" to their mail() commands, I decided to write a patch which, if no Return-Path header was set, would use the >From header instead (if it existed, of course). I'm pretty sure this is not the right thing (tm) to do, as I should rather fix this problem with my MTA. However, I am currently too dumb to understand qmail's sources (DJB should have really commented his sourcecode), therefore I just did this quick fix. I posted it here because I heard others having the same problem. All others please just ignore this posting :) Warning(s): - This is NOT a general-purpose patch (do not apply to main branch) - This patch probably breaks all rules on coding style and consistency (malloc instead of emalloc etc..) - I know C for only a couple of weeks. Don't blame me if everything crashes and your machine burns down. -daniel
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php