Today I tried to configure the sender for sendmail in php. There are some ways how to do it, so I share my solution.
There is a sendmail_from setting in php cli and php fpm, but it is usually empty. So sendmail fallsback to
user@hostname (given you are logged in as user and the machine is called hostname).
But I found a better way (maybe even easier to extend). Just change the sendmail_path to something with an extra
-f [email protected] at the end.