Howto change email header in emails send from PHP

Hello, all emails, which I send from PHP mail() have the header like:

Received: from nginx by localhost with local (Exim 4.63)
(envelope-from nginx@localhost)

How I can change the address to something like [email protected] there?

Thank You

php code:
mail(“[email protected]”,“subject”,“messagecontents”,“From:
[email protected]”);

so, headers is a php issue, and can be set in php mail function.
http://php.net/manual/en/function.mail.php

Bahattin,
ehcp Developer

I am using CakePHP framework, so I set this variables:
$this->Email->from =
Configure::read(‘Site.noreplyemail’);
$this->Email->return =
Configure::read(‘Site.noreplyemail’);
$this->Email->replyTo=Configure::read(‘Site.noreplyemail’);
where Configure::read(‘Site.noreplyemail’) is the email address

But this didnt changed all the address in header. The email header is
below:

Delivered-To: [email protected]
Received: by 10.204.121.3 with SMTP id f3cs5634bkr;
Fri, 24 Sep 2010 02:43:02 -0700 (PDT)
Received: by 10.100.154.3 with SMTP id b3mr3322700ane.245.1285321381720;
Fri, 24 Sep 2010 02:43:01 -0700 (PDT)
Return-Path: nginx@mydomain
Received: from mydomain (mail.mydomain.com [xxx.xxx.xxx.xxx])
by mx.google.com with ESMTP id
d19si4617117and.113.2010.09.24.02.43.01;
Fri, 24 Sep 2010 02:43:01 -0700 (PDT)
Received-SPF: neutral (google.com: xxx.xxx.xxx.xxx is neither
permitted nor denied by best guess record for domain of
nginx@mydomain) client-ip=xxx.xxx.xxx.xxx;
Authentication-Results: mx.google.com; spf=neutral (google.com:
xxx.xxx.xxx.xxx is neither permitted nor denied by best guess record
for domain of nginx@mydomain) smtp.mail=nginx@mydomain
Received: from nginx by mydomain with local (Exim 4.63)
(envelope-from nginx@mydomain)
id 1Oz4o1-0000Bd-4h
for [email protected]; Fri, 24 Sep 2010 09:43:01 +0000
To: [email protected]
Subject: Account Activation
From: [email protected]
Reply-To: [email protected]
X-Mailer: CakePHP Email Component
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Message-Id: E1Oz4o1-0000Bd-4h@mydomain
Sender: Nginx user nginx@mydomain
Date: Fri, 24 Sep 2010 09:43:01 +0000

2010/9/24 bvidinli [email protected]:

On Fri, Sep 24, 2010 at 12:06 PM, Frank R. [email protected] wrote:

nginx mailing list
[email protected]
nginx Info Page


nginx mailing list
[email protected]
nginx Info Page


FandaR-IT - Server administration and programming
http://fandar-it.com
MSN: [email protected]
ICQ: 217613557
GTalk: [email protected]
Yahoo: fandar2

those seems to be headers sent by your MTA, such as postfix.

set servername related parameters of postifx accordingly.

Hello!

On Fri, Sep 24, 2010 at 11:06:08AM +0200, Frank R. wrote:

Hello, all emails, which I send from PHP mail() have the header like:

Received: from nginx by localhost with local (Exim 4.63)
(envelope-from nginx@localhost)

How I can change the address to something like [email protected] there?

Hey, guys, it’s not PHP list. Please stop. Thank you.

Maxim D.

The problem is, that nginx is running under nginx user, so the email
address is [email protected], but how can I change it to
[email protected] ?

2010/9/24 bvidinli [email protected]:

           $this->Email->replyTo=Configure::read('Site.noreplyemail');

Received: from mydomain (mail.mydomain.com [xxx.xxx.xxx.xxx])
id 1Oz4o1-0000Bd-4h
Date: Fri, 24 Sep 2010 09:43:01 +0000

Bahattin,

Thank You
nginx Info Page
Yahoo: fandar2
nginx Info Page


FandaR-IT - Server administration and programming
http://fandar-it.com
MSN: [email protected]
ICQ: 217613557
GTalk: [email protected]
Yahoo: fandar2

On 24 Set 2010 15h09 WEST, [email protected] wrote:

The problem is, that nginx is running under nginx user, so the email
address is [email protected], but how can I change it to
[email protected] ?

Create an alias for your MTA.: man 5 aliases

For example:

echo ‘nginx: [email protected]’ >> /etc/aliases

Reload MTA. Done.

— appa