Add this to sendmail.cf:
Originally Posted by banditti
to force it to send on address 184.108.40.206.
You might also want to look into using SPF records for your domains to specify the legitimate sending host(s).
Things get tricky with mail sent from PHP forms. By default, the SMTP envelope sender will be firstname.lastname@example.org unless you have some form of masquerading set up in sendmail. You might want to consider using custom From headers in the PHP mail() command like this:
You'll need to add the apache user to the list in /etc/mail/trusted-users so PHP can rewrite the SMTP sender without generating a warning header.
One other option is to create an entry in /etc/mail/genericstable like this:
Now sendmail should automatically rewrite mail sent by the www-data user to use email@example.com as the SMTP sender. This has less flexibility than the other approach since all your domains will have their mail sent from firstname.lastname@example.org.
echo 'www-data email@example.com' >> genericstable
makemap genericstable < genericstable