On Fri, Jul 18, 2003 at 11:00:18AM -0400, Brian S. Drexler wrote:
> 
> Ok, I want to specify who the mail is coming from by using the sendmail_path
> option in the PHP.ini.  I've added the [EMAIL PROTECTED] to it, but I want
> to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or
> whatever else.  Anyone have any ideas how I can do this?  I'm pulling the
> e-mail I'd like to change it to from a MySQL database but can I rewrite the
> php.ini file on the fly or am I stuck.  Any help is greatly appreciated.

You can't change the Return-Path header, because it's not set by the
sender.  It's added by the *receiving* mail server, and reflects the
from address in the SMTP envelope, rather than anything in the headers
of the message itself.

It sounds heinous, but one solution might be to make your sendmail_path
a *wrapper* that will look at certain environment variables and come
up with a -f option with which to launch sendmail.  I don't recommend
this solution.

Another possibility might be to run PHP inside FastCGI and use suexec.
If the PHP script is being executed this way, I would think that any
sendmail processe launched would have the username in the envelope-from.
You also might get a performance gain by doing things through FastCGI,
though you'd lose some of the module-specific features like persistent
database connections.

Worth testing, anyway.  Let us know how it goes.  :)

-- 
  Paul Chvostek                                             <[EMAIL PROTECTED]>
  it.canada                                            http://www.it.ca/
  Free PHP web hosting!                            http://www.it.ca/web/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to