This is annoying. I ssh to a server, then, it doesn't matter if I su - or sudo -s, I start a service (motion, if it matters), and when the service sends an email, it's from me, not from root, or the user the service runs as.
I've dumped my environment, I've just dumped service's environment. I've set SUDO_USER to root, and SUDO_UID to 0, and restarted the service, and still no joy.
My manager found this trick: echo "To: user
help " | sendmail -t
and the same thing happens.
Anyone else run into this? No relevant google hits so far.
mark