I’ve been seeing up an Amazon EC-2 server with Debian Squeeze and used tasksel to install Web Server and Mail Server. Like all things debian, this worked pretty well after the installation completed and everything ‘just worked’ however I wasn’t happy with the default from name and email address assigned to emails sent by PHP – www-data <email@example.com>.
I discovered a quick and simple fix to change these defaults for all mail sent with PHP:
Open /etc/php5/apache2/php.ini and set
sendmail_path = '/usr/sbin/sendmail -t -i -firstname.lastname@example.org -Fno-reply'
You can see a list of sendmail arguments and what they do here.
Restart apache and you’re good to go:
sudo service apache2 restart