note 5033 deleted from function.mail by jimw

From: Date: Wed, 31 Oct 2001 23:00:09 +0000
Subject: note 5033 deleted from function.mail by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-19852@lists.php.net to get a copy of this message
After much research, and more than a little time spent, I have found an answer to the "problem" of headers in received mail like From:nobody@localhost. RFC822 makes it plain that the header "Return-path" is intended to be added to the message by the mail program at the destination(POP3), not at the source(SMTP). Adding it as a header to a mail() function will have no effect as mail() is the source. If you have PHP compiled into Apache, then PHP mail() sends email to sendmail as the owner of the process which, of course, is 'nobody'. So sendmail will use 'nobody' in the "From" field of the sendmail generated portion of the header. The solution is to follow the instructions in the sendmail configuation to reverse-map outgoing mail to "somebody@yourserver". Here is the URL to those instructions: http://www.sendmail.org/virtual-hosting.html Follow instructions 6 and 7 and you will have no further problems. I will be changing my FormMail script to reflect this info soon. Good luck.

« previous php.notes (#19852) next »