This is more a note for myself than anything else ...
By default a lot of php scripts will send emails that appear as coming from the Apache user, which makes tracking down a rogue script really annoying and time-consuming.
You end up with entries in the mail logs similar to this one:
Which isn't particularly helpful if you have more than one site (vhost) on a particular server.
Making it a bit saner can be done via a simple addition to the Apache vhost config:
So now any emails sent from that vhost will reference the email specified instead of the Apache user:
By default a lot of php scripts will send emails that appear as coming from the Apache user, which makes tracking down a rogue script really annoying and time-consuming.
You end up with entries in the mail logs similar to this one:
Apr 27 18:22:29 servername postfix/qmgr[23581]: 0F53421C1FA: from=<www-data@servername.com>, size=929, nrcpt=1 (queue active)
Which isn't particularly helpful if you have more than one site (vhost) on a particular server.
Making it a bit saner can be done via a simple addition to the Apache vhost config:
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f address@domain.tld'
So now any emails sent from that vhost will reference the email specified instead of the Apache user:
Apr 27 19:40:34 servername postfix/qmgr[2469]: 16A8F21C1FA: from=<address@domain.tld>, size=358, nrcpt=1 (queue active)There are other additions to Php that can log the path to the script itself, though until such time as someone makes it available for Debian / Ubuntu I don't really fancy having to compile it in manually


![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=65321d5f-a4f4-4a8d-9660-a377ec709e81)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=85dafcbf-e40a-4737-84c8-ca518a031109)


