Re: Mail Problem
| From: | Travis Doherty | Date: | Tue, 26 Sep 2006 22:08:10 +0000 |
| Subject: | Re: Mail Problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-242241@lists.php.net to get a copy of this message | ||
Richard Lynch wrote:
>>if(!mail($to,$subject,$msg,$headers)) { die("Unable to send"); }
>>
>>
>
>*IF* you are using PHP5 (?) and *IF* your security settings allow it,
>the optional fifth argument will let you specify the "real" sender of
>the message, which the responder may or may not be using to bounce to.
>
>http://php.net/mail
>
>
Richard is correct on that. The fifth argument isn't only for the
envelope sender, so ensure you include the '-f' for sendmail and compat.
wrappers.
php.net/mail: ChangeLog:
"4.0.5 The additional_parameters parameter was added."
>... which the responder may or may not be using to bounce to.
>
>
They should *always* be sending to the envelope from address (SMTP `MAIL
FROM
command), with an empty envelope sender (SMTP MAIL FROM:<>`) to
avoid loops.
The RFC's are a rather in depth, so here is an excerpt from Wikipedia
that pretty much sums up what the RFCs do contain:
[http://en.wikipedia.org/wiki/Bounce_message]
> The Return-Path is visible in delivered mail as header field
> Return-Path inserted by the final SMTP mail transfer agent
> <http://en.wikipedia.org/wiki/Mail_transfer_agent> (MTA),
> also known
> as mail delivery agent
> <http://en.wikipedia.org/wiki/Mail_delivery_agent> (MDA).
> The MDA
> simply copies the *reverse path* in the SMTP MAIL FROM command into
> the Return-Path. The MDA also removes bogus Return-Path header fields
> inserted by other MTAs, this header field is generally guaranteed to
> reflect the last reverse path seen in the MAIL FROM command.
Travis Doherty