php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #37122 sendmail_from is Return-Path:, not From:
Submitted: 2006-04-18 17:35 UTC Modified: 2006-04-30 19:29 UTC
From: php-bugs at t43 dot mine dot nu Assigned:
Status: Closed Package: Documentation problem
PHP Version: * OS: *
Private report: No CVE-ID: None
 [2006-04-18 17:35 UTC] php-bugs at t43 dot mine dot nu
Description:
------------
The "sendmail_from" value from php.ini goes into the header Return-Path:, not into From: When it is not set, the From: header is required and duplicated into Return-Path:. Return-Path: cannot be set in the headers.
sendmail_from has priority over From: f?r the Return-Path:

 A comment to Bug 14407 indeed says that sendmail_from is Return-Path: but this information is missing in the manual and opposite to what is written, namely that sendmail_from goes into From:.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-18 17:36 UTC] php-bugs at t43 dot mine dot nu
applies to version 5.1.2
 [2006-04-18 22:51 UTC] php-bugs at t43 dot mine dot nu
similar bugs for mail() on Windows, but software-related, are 28038, 37073. Mine is documentation-related.
 [2006-04-23 13:37 UTC] bjori@php.net
AFAICT "Return-Path" isn't set by PHP at all unless you specificly put it in the headers yourself.

The sendmail_from however seems to override (if specified) the "From" header which either needs to be documented or fixed.

Possible fix: http://php.is/bugs/37122/win32.sendmail.patch.txt

(Reclassified as php bug).
-Hannes
 [2006-04-23 14:12 UTC] php-bugs at t43 dot mine dot nu
The comment from bjori@php.net does not match what I have observed, in Windows. I observe exactly the opposite, sentence by sentence.

I looked at the mails produced on the receiver side, of course. Others have also observed, and reported, that sendmail_from makes the Return-Path: header.
 [2006-04-23 22:02 UTC] bjori@php.net
I've managed to get my hands on windows machine to verify this.

It is correct, for what ever reason the sendmail_from php.ini directive is used as "Return-Path" too and it can't be changed via the additional_headers parameter.

If "From:" header isn't set as additional header the sendmail_from ini directive is used.

How do you feel about the following patch?
http://php.is/bugs/37122/win32.mail.ini.patch.txt
 [2006-04-23 23:36 UTC] php-bugs at t43 dot mine dot nu
First big thanks that you did something on my report. 

I'm not fluent in the php-manual editing or in english language, but it works yet a bit different:

"sendmail_from": Which "Return-Path:" mail address should be used in mail sent from PHP under Windows. (If not set, and From: is given in $headers, From: gets duplicated as "Return-Path:" as well. If none is set, mail() does fail. Again, this is for Windows).

Please note at least three points: 
- I don't know why Return-Path: seems required by SMTPs, but every single mail I looked at has it. According to RFC2822, Sender: would be more required, but it never occurred to me.
- mail() on Windows is entirely different from mail() on Un*x. 
- mail() is mainly for beginners like me. Experienced people (like I'll be, soon) use PHPmailer, and later go for PEAR::mail.

Nevertheless it makes sense to have mail().
 [2006-04-25 12:45 UTC] bjori@php.net
> "sendmail_from": Which "Return-Path:" mail address should be used in mail sent from PHP under Windows.
> If not set, and From: is given in $headers, From: gets duplicated as "Return-Path:" as well.
It's not a PHP "problem", it's your MTA that does this. But I do think we should apply my previous patch.

> If none is set, mail() does fail.
It is noted at php.net/function.mail that the "From:" header is required.

> Please note at least three points:
Your last two are noted in the manual

-Hannes
 [2006-04-26 11:40 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

"This directive also sets the "Return-Path:" header."
 [2006-04-27 15:26 UTC] php-bugs at t43 dot mine dot nu
May I suggest:
"sendmail_from: what to use as FROM in the SMTP Transaction. (If missing, From: from the headers is used as FROM)"

Comment to this: In fact the header fields From: and Return-Path: are not really relevant, but FROM is relevant. I wasn't aware of the difference between SMTP commands and mail headers when I initiated the bug.
 [2006-04-30 19:29 UTC] bjori@php.net
Sure, you may suggest it :), but I think it will only confuse people even more.

-Hannes
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 12:01:29 2024 UTC