making php use "mail" instead of sendmail
Im using debian stable.
how do I get php to use "/usr/bin/mail" instead of "sendmail" to send local mail (that is, on the same machine, to a user)? I've set sendmail_path = /usr/bin/mail but no success. here's the revelant part of my php.ini file: TIA Code:
[mail function] |
I doubt that is a good idea. ftp://ftp.porcupine.org/pub/security/murphy.pdf
|
Your file says
Quote:
|
The problem is that mail is a mail user agent (MUA), and sendmail a mail transfer agent(MTA).
PHP is using sendmail to transfer mail from it to another (possibly remote) server. So in this structure, PHP is acting as the user agent. One difference between MUA and MTA is that in sending mail from a user agent the destination address is expected on the command line. In the MTA it is expected as part of the input stream. That is what the -t option on the default is for, it scans the input message for To:, Cc:, and Bcc for destination addresses. The MUA expects that to be on the command line. One advantage the sendmail used in this manner is that it is the one that determines whether a remote destination or a local one is needed. If local delivery is called for, then it goes directly to the local mail files without involving any other process. Now that said, if you have a local mail deliver (sendmail or other) you CAN get the equivalent. What you use is "telnet localhost 25" (assuming your local mail server is using port 25 by default. This may accept the message (unless it requires a password or some extra handshaking) and blindly accept the data. It isn't correct, as this ignores the handshaking that may be required (things like "address invalid" or "user invalid" or "reject" responses). This additional handshaking is another reason PHP uses sendmail - the appropriate handshaking is already done. You CAN replace sendmail with something like qmail or postfix (not an endorsement - I happen to like sendmail due to its flexibility. but others do). |
All times are GMT -5. The time now is 12:23 PM. |